-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32688][SQL][TEST] Add special values to LiteralGenerator for float and double #29515
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8c8313c
Add special values to LiteralGenerator for float and double
tanelk 77d63ac
Add 'MaxValue' to LiteralGenerator for float and double
tanelk 818abe2
Ensure -0.0 and 0.0 comparison consistency
tanelk 1116d3d
Revert equality check
tanelk 2dce36e
test -0.0 equality for complex types
tanelk 9a3b983
Add -0.0 as special value to RandomDataGenerator
tanelk d20a2ed
revert test -0.0 equality for complex types
tanelk 529aba8
revert test -0.0 equality for complex types
tanelk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
At least, we shoud fix the existing test failures that we found in this PR. But, this fix looks improper, so could we use
NormalizeNaNAndZeroinstead? cc: @cloud-fan @viiryaUh oh!
There was an error while loading. Please reload this page.
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.
NormalizeNaNAndZerocan't help here, becausecheckConsistencyBetweenInterpretedAndCodegenis done without optimizers.Also it could introduce new correctness issues with
atan2(-0.0, x)and1.0 / -0.0.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.
I assumed that
0.0 == -0.0is the expected behavior, but if it is not, then we could leave this as it was change the code gen path.Uh oh!
There was an error while loading. Please reload this page.
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.
But, how about the case
array(-0.0) == array(0.0)?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.
You are 100% correct.
It is an interesting problem, where the same comparator is used for both sorting and equality check.
For sorting
-0.0should be smaller than0.0, but in equality check they should be equal.Just for reference, it seems that both hive and mysql consider them equal in the equality check:
https://issues.apache.org/jira/browse/HIVE-11174