-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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-6680] RexImpTable erroneously declares NullPolicy.NONE for IS_EMPTY #4039
Conversation
@@ -1019,7 +1019,7 @@ void populate2() { | |||
defineMethod(ARRAY_EXCEPT, BuiltInMethod.ARRAY_EXCEPT.method, NullPolicy.ANY); | |||
defineMethod(ARRAY_JOIN, BuiltInMethod.ARRAY_TO_STRING.method, | |||
NullPolicy.STRICT); | |||
defineMethod(ARRAY_INSERT, BuiltInMethod.ARRAY_INSERT.method, NullPolicy.NONE); | |||
defineMethod(ARRAY_INSERT, BuiltInMethod.ARRAY_INSERT.method, NullPolicy.ARG0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this ARG0 instead of STRICT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you can insert a NULL value into an array and the result is not NULL
9adf204
to
defa56e
Compare
return lt(b0, b1) ? b0 : b1; | ||
} | ||
|
||
public static @Nullable <T extends Comparable<T>> List<T> greater( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add JavaDoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are at least 10 versions of this function in this file, which share one common comment.
@@ -448,4 +448,177 @@ EXPR$0 | |||
[2.111111111111112, 2.1] | |||
!ok | |||
|
|||
# Tests for CALCITE-6680 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any verification in Spark?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is based on the spec of these functions in Calcite. I don't have access to a Spark system.
We should build a proper way to test queries on other systems, not do it manually, this is not sustainable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…S_EMPTY Signed-off-by: Mihai Budiu <[email protected]>
a3b2641
to
9f23026
Compare
Quality Gate passedIssues Measures |
Based on a patch submitted in Jira by Chris Dennis
https://issues.apache.org/jira/secure/attachment/13072690/is-empty-nullable.patch
Had to tweak some other parts of Calcite, since the Java type system claimed arrays and maps cannot be null.
I inspected some other array operations as well, hopefully I didn't miss any.