-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-8636][SQL] Fix equalNullSafe comparison #7040
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
|
Just changing the loop structure is not sufficient because changing the loop structure causes the case when tests in ConditionalExpressionSuite to fail. |
|
Ok, I'll update that test suite. @smola , In predicates.scala, eval method of case class EqualNullSafe has similar if (l == null && r == null) check , shall I modify that condition too? |
|
Sorry for opening another PR @vinodkc |
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.
This is far enough from Java/Scala semantics that it warrants a scaladoc and a pointer to NULL semantics in SQL, IMO
|
ok to test |
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.
We should at least consider renaming this function. Null safe equals in sql typically returns true for null <=> null
http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_equal-to
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.
@marmbrus
Shall I rename the function private def equalNullSafe(l: Any, r: Any)
to private def equal(l: Any, r: Any) ?
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.
or threeValueEquals ?
|
Test build #36862 has finished for PR 7040 at commit
|
|
According to the JIRA, if |
|
Test build #37120 has finished for PR 7040 at commit
|
|
I'm going to merge this to fix the bug. Thanks! Feel free to do a follow-up to further simplify / optimize. |
Author: Vinod K C <[email protected]> Closes #7040 from vinodkc/fix_CaseKeyWhen_equalNullSafe and squashes the following commits: be5e641 [Vinod K C] Renamed equalNullSafe to threeValueEquals aac9f67 [Vinod K C] Updated test suite and genCode method f2d0b53 [Vinod K C] Fix equalNullSafe comparison
|
Can one of the admins verify this patch? |
|
Can you close this please, now that it has been merged? |
No description provided.