-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Make sqllogictest platform-independent for the sign of NaN #7462
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e74cb3c
Revert "Make sqllogictest distinguish NaN from -NaN (#7403)"
sarutak aa6bcf9
Make sqllogictests platform-independent for the sign of NaNs
sarutak 350d220
Add comment
sarutak 3853d4e
Resolve conflict
sarutak 1a5b5a8
Ensure -NaN is parsed as -NaN
sarutak 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -255,81 +255,82 @@ fazzz | |
|
|
||
| statement ok | ||
| CREATE TABLE IF NOT EXISTS test_float AS VALUES | ||
| (1.2, 2.3, 1.2, -3.5, 1.1), | ||
| (2.1, 'NaN'::double, -1.7, -8.2, NULL), | ||
| (NULL, NULL, '-NaN'::double, -5.4, 1.5), | ||
| ('NaN'::double, 'NaN'::double, 1.1, '-NaN'::double, NULL), | ||
| ('-NaN'::double, 6.2, 'NaN'::double, -3.3, 5.6) | ||
| ('a', 1.2, 2.3, 1.2, -3.5, 1.1), | ||
| ('b', 2.1, 'NaN'::double, -1.7, -8.2, NULL), | ||
| ('c', NULL, NULL, '-NaN'::double, -5.4, 1.5), | ||
| ('d', 'NaN'::double, 'NaN'::double, 1.1, '-NaN'::double, NULL), | ||
| ('e', '-NaN'::double, 6.2, 'NaN'::double, -3.3, 5.6) | ||
| ; | ||
|
|
||
| # IN expr for float | ||
| query R | ||
| SELECT column1 FROM test_float WHERE column1 IN (0.0, -1.2) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (0.0, -1.2) | ||
| ---- | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE column1 IN (0.0, 1.2) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (0.0, 1.2) | ||
| ---- | ||
| 1.2 | ||
| a | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE column1 IN (2.1, 1.2) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (2.1, 1.2) | ||
| ---- | ||
| 1.2 | ||
| 2.1 | ||
| a | ||
| b | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE column1 IN (0.0, 1.2, NULL) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (0.0, 1.2, NULL) | ||
| ---- | ||
| 1.2 | ||
| a | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE column1 IN (0.0, -1.2, NULL) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (0.0, -1.2, NULL) | ||
| ---- | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE column1 IN (0.0, 1.2, 'NaN'::double, '-NaN'::double) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (0.0, 1.2, 'NaN'::double, '-NaN'::double) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified this test which is sign sensitive not to show |
||
| ---- | ||
| 1.2 | ||
| NaN | ||
| -NaN | ||
| a | ||
| d | ||
| e | ||
|
|
||
| query RRRRR | ||
| SELECT * FROM test_float WHERE column1 IN (column2, column3, column4, column5) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (column3, column4, column5, column6) | ||
| ---- | ||
| 1.2 2.3 1.2 -3.5 1.1 | ||
| NaN NaN 1.1 -NaN NULL | ||
| a | ||
| d | ||
|
|
||
| query RRRRR | ||
| SELECT * FROM test_float WHERE column1 IN (column2, column3, column4, column5, 2.1, NULL, '-NaN'::double) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 IN (column3, column4, column5, column6, 2.1, NULL, '-NaN'::double) | ||
| ---- | ||
| 1.2 2.3 1.2 -3.5 1.1 | ||
| 2.1 NaN -1.7 -8.2 NULL | ||
| NaN NaN 1.1 -NaN NULL | ||
| -NaN 6.2 NaN -3.3 5.6 | ||
| a | ||
| b | ||
| d | ||
| e | ||
|
|
||
| query RRRRR | ||
| SELECT * FROM test_float WHERE column1 NOT IN (column2, column3, column4, column5) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 NOT IN (column3, column4, column5, column6) | ||
| ---- | ||
| -NaN 6.2 NaN -3.3 5.6 | ||
| e | ||
|
|
||
| query RRRRR | ||
| SELECT * FROM test_float WHERE column1 NOT IN (column2, column3, column4, column5, 2.1, NULL, '-NaN'::double) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE column2 NOT IN (column3, column4, column5, column6, 2.1, NULL, '-NaN'::double) | ||
| ---- | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE NULL IN (column1, column1 + 1, column1 + 2, column1 + 3) | ||
|
|
||
| query T | ||
| SELECT column1 FROM test_float WHERE NULL IN (column2, column2 + 1, column2 + 2, column2 + 3) | ||
| ---- | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE 'NaN'::double IN (column1, column1 + 1, column1 + 2, column1 + 3) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE 'NaN'::double IN (column2, column2 + 1, column2 + 2, column2 + 3) | ||
| ---- | ||
| NaN | ||
| d | ||
|
|
||
| query R | ||
| SELECT column1 FROM test_float WHERE '-NaN'::double IN (column1, column1 + 1, column1 + 2, column1 + 3) | ||
| query T | ||
| SELECT column1 FROM test_float WHERE '-NaN'::double IN (column2, column2 + 1, column2 + 2, column2 + 3) | ||
| ---- | ||
| -NaN | ||
| e | ||
|
|
||
| query II | ||
| SELECT c3, c7 FROM aggregate_test_100 WHERE c3 IN (c7 / 10, c7 / 20, c7 / 30, c7 / 40, 68, 103) | ||
|
|
||
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.
Hmm, you mean on different platform, a same value could be positive and negative?
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.
If so, maybe it good to leave a comment here.
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.
Yes. a function/operation can return
-NaNon x86 whileNaNon Arm.