-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24562][TESTS] Support different configs for same test in SQLQueryTestSuite #21568
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 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
193 changes: 193 additions & 0 deletions
193
.../decimalArithmeticOperations.sql_spark.sql.decimalOperations.allowPrecisionLoss-false.out
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 |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| -- Automatically generated by SQLQueryTestSuite | ||
| -- Number of queries: 23 | ||
|
|
||
|
|
||
| -- !query 0 | ||
| CREATE TEMPORARY VIEW t AS SELECT 1.0 as a, 0.0 as b | ||
| -- !query 0 schema | ||
| struct<> | ||
| -- !query 0 output | ||
|
|
||
|
|
||
|
|
||
| -- !query 1 | ||
| select a / b from t | ||
| -- !query 1 schema | ||
| struct<(CAST(a AS DECIMAL(2,1)) / CAST(b AS DECIMAL(2,1))):decimal(8,6)> | ||
| -- !query 1 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 2 | ||
| select a % b from t | ||
| -- !query 2 schema | ||
| struct<(CAST(a AS DECIMAL(2,1)) % CAST(b AS DECIMAL(2,1))):decimal(1,1)> | ||
| -- !query 2 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 3 | ||
| select pmod(a, b) from t | ||
| -- !query 3 schema | ||
| struct<pmod(CAST(a AS DECIMAL(2,1)), CAST(b AS DECIMAL(2,1))):decimal(1,1)> | ||
| -- !query 3 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 4 | ||
| create table decimals_test(id int, a decimal(38,18), b decimal(38,18)) using parquet | ||
| -- !query 4 schema | ||
| struct<> | ||
| -- !query 4 output | ||
|
|
||
|
|
||
|
|
||
| -- !query 5 | ||
| insert into decimals_test values(1, 100.0, 999.0), (2, 12345.123, 12345.123), | ||
| (3, 0.1234567891011, 1234.1), (4, 123456789123456789.0, 1.123456789123456789) | ||
| -- !query 5 schema | ||
| struct<> | ||
| -- !query 5 output | ||
|
|
||
|
|
||
|
|
||
| -- !query 6 | ||
| select id, a+b, a-b, a*b, a/b from decimals_test order by id | ||
| -- !query 6 schema | ||
| struct<id:int,(a + b):decimal(38,18),(a - b):decimal(38,18),(a * b):decimal(38,36),(a / b):decimal(38,18)> | ||
| -- !query 6 output | ||
| 1 1099 -899 NULL 0.1001001001001001 | ||
| 2 24690.246 0 NULL 1 | ||
| 3 1234.2234567891011 -1233.9765432108989 NULL 0.000100037913541123 | ||
| 4 123456789123456790.123456789123456789 123456789123456787.876543210876543211 NULL 109890109097814272.043109406191131436 | ||
|
|
||
|
|
||
| -- !query 7 | ||
| select id, a*10, b/10 from decimals_test order by id | ||
| -- !query 7 schema | ||
| struct<id:int,(CAST(a AS DECIMAL(38,18)) * CAST(CAST(10 AS DECIMAL(2,0)) AS DECIMAL(38,18))):decimal(38,18),(CAST(b AS DECIMAL(38,18)) / CAST(CAST(10 AS DECIMAL(2,0)) AS DECIMAL(38,18))):decimal(38,19)> | ||
| -- !query 7 output | ||
| 1 1000 99.9 | ||
| 2 123451.23 1234.5123 | ||
| 3 1.234567891011 123.41 | ||
| 4 1234567891234567890 0.1123456789123456789 | ||
|
|
||
|
|
||
| -- !query 8 | ||
| select 10.3 * 3.0 | ||
| -- !query 8 schema | ||
| struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> | ||
| -- !query 8 output | ||
| 30.9 | ||
|
|
||
|
|
||
| -- !query 9 | ||
| select 10.3000 * 3.0 | ||
| -- !query 9 schema | ||
| struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> | ||
| -- !query 9 output | ||
| 30.9 | ||
|
|
||
|
|
||
| -- !query 10 | ||
| select 10.30000 * 30.0 | ||
| -- !query 10 schema | ||
| struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> | ||
| -- !query 10 output | ||
| 309 | ||
|
|
||
|
|
||
| -- !query 11 | ||
| select 10.300000000000000000 * 3.000000000000000000 | ||
| -- !query 11 schema | ||
| struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,36)> | ||
| -- !query 11 output | ||
| 30.9 | ||
|
|
||
|
|
||
| -- !query 12 | ||
| select 10.300000000000000000 * 3.0000000000000000000 | ||
| -- !query 12 schema | ||
| struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,37)> | ||
| -- !query 12 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 13 | ||
| select 2.35E10 * 1.0 | ||
| -- !query 13 schema | ||
| struct<(CAST(2.35E+10 AS DECIMAL(12,1)) * CAST(1.0 AS DECIMAL(12,1))):decimal(6,-7)> | ||
| -- !query 13 output | ||
| 23500000000 | ||
|
|
||
|
|
||
| -- !query 14 | ||
| select (5e36 + 0.1) + 5e36 | ||
| -- !query 14 schema | ||
| struct<(CAST((CAST(5E+36 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5E+36 AS DECIMAL(38,1))):decimal(38,1)> | ||
| -- !query 14 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 15 | ||
| select (-4e36 - 0.1) - 7e36 | ||
| -- !query 15 schema | ||
| struct<(CAST((CAST(-4E+36 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7E+36 AS DECIMAL(38,1))):decimal(38,1)> | ||
| -- !query 15 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 16 | ||
| select 12345678901234567890.0 * 12345678901234567890.0 | ||
| -- !query 16 schema | ||
| struct<(12345678901234567890.0 * 12345678901234567890.0):decimal(38,2)> | ||
| -- !query 16 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 17 | ||
| select 1e35 / 0.1 | ||
| -- !query 17 schema | ||
| struct<(CAST(1E+35 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,3)> | ||
| -- !query 17 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 18 | ||
| select 1.2345678901234567890E30 * 1.2345678901234567890E25 | ||
| -- !query 18 schema | ||
| struct<(CAST(1.2345678901234567890E+30 AS DECIMAL(25,-6)) * CAST(1.2345678901234567890E+25 AS DECIMAL(25,-6))):decimal(38,-17)> | ||
| -- !query 18 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 19 | ||
| select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 | ||
| -- !query 19 schema | ||
| struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,7)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,7))):decimal(38,7)> | ||
| -- !query 19 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 20 | ||
| select 123456789123456789.1234567890 * 1.123456789123456789 | ||
| -- !query 20 schema | ||
| struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,28)> | ||
| -- !query 20 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 21 | ||
| select 12345678912345.123456789123 / 0.000000012345678 | ||
| -- !query 21 schema | ||
| struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,18)> | ||
| -- !query 21 output | ||
| NULL | ||
|
|
||
|
|
||
| -- !query 22 | ||
| drop table decimals_test | ||
| -- !query 22 schema | ||
| struct<> | ||
| -- !query 22 output | ||
|
|
||
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
Oops, something went wrong.
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.
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.
This new feature looks good to me. Btw, if we set multiple configurations, filenames get too long? How about adding the configuration info. in the head of files? Then, filenames are;
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.
Since we have two cases:
1 - Different configs produce different results (so different files) and in this case your suggestion is fine;
2 - Different configs produce the same results (so we have one golden file for all of them), how would you address this case?
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 was thinking the second case also output multiple same result files for each config.