-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-10323] [SQL] fix nullability of In/InSet/ArrayContain #8492
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
Conversation
|
cc @yhuai |
|
Test build #41712 has finished for PR 8492 at commit
|
|
Here is the output of some sample tests using hive 1.2.1 |
|
postgresql's output regarding http://www.postgresql.org/docs/devel/static/functions-comparisons.html (looks like ANY/SOME (array) part is for |
|
OK. I guess the main question at here is if we want to have a different semantic with hive on |
|
From PostgresSQL: If the array expression yields a null array, the result of ANY will be null. If the left-hand expression yields null, the result of ANY is ordinarily null (though a non-strict comparison operator could possibly yield a different result). Also, if the right-hand array contains any null elements and no true comparison result is obtained, the result of ANY will be null, not false (again, assuming a strict comparison operator). This is in accordance with SQL's normal rules for Boolean combinations of null values. It's more consistent in PostgresSQL, I'd like to follow it. |
|
I'd follow postgres here. |
|
Test build #1701 has finished for PR 8492 at commit
|
|
Test build #41727 has finished for PR 8492 at commit
|
|
Test build #41733 has finished for PR 8492 at commit
|
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.
Looks like we need to swap left and right?
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.
Do we need to call {defineCodeGen}?
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.
nullSafeCodeGen is similar to defineCodeGen
|
+1 to follow postgres. |
|
Test build #41751 has finished for PR 8492 at commit
|
|
Test build #41753 has finished for PR 8492 at commit
|
|
LGTM |
|
Merged into master and 1.5 branch. |
After this PR, In/InSet/ArrayContain will return null if value is null, instead of false. They also will return null even if there is a null in the set/array. Author: Davies Liu <[email protected]> Closes #8492 from davies/fix_in. (cherry picked from commit bb7f352) Signed-off-by: Davies Liu <[email protected]>
After this PR, In/InSet/ArrayContain will return null if value is null, instead of false. They also will return null even if there is a null in the set/array.