Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-6764] Field access from a nullable ROW should be nullable #4127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mihaibudiu
Copy link
Contributor

No description provided.

@@ -160,15 +155,7 @@ public int getFailureCount() {
++failCount;
return litmus.fail(null);
}
final RelDataTypeField typeField = refType.getFieldList().get(index);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the process of my use, the verification here is indeed effective. If only the nullability value is different, we can add 'RelOptUtil. eqIgnoreNullable'` to replace it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will add this check back.

@@ -65,6 +67,18 @@ public class RexFieldAccess extends RexNode {
this.expr = expr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can directly use this(expr, field, field.getType()); .

CalciteConnection calciteConnection = connection.unwrap(CalciteConnection.class);
calciteConnection.getRootSchema().add("T", new RowTable());
Statement statement = calciteConnection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT P['a'].K FROM T");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to verify the metadataResultSet#getMetaData is nullable? I'm not sure if this is possible.

Copy link
Contributor Author

@mihaibudiu mihaibudiu Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no nullability information as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants