Skip to content

Commit

Permalink
DRILL-7615: Added tests to verify that decimal columns work correctly…
Browse files Browse the repository at this point in the history
… with UNION operator (#603)

Also renamed existing tests according to the project naming convention
  • Loading branch information
dkondriu authored Apr 6, 2020
1 parent 919d931 commit bd2d0f4
Show file tree
Hide file tree
Showing 145 changed files with 117 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.000
596.000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,1))
UNION
SELECT 596.000;
2 changes: 2 additions & 0 deletions framework/resources/Functional/union/CastToOneDecimals.e_tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.0
596.0
3 changes: 3 additions & 0 deletions framework/resources/Functional/union/CastToOneDecimals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,1))
UNION
SELECT cast(596.000 as decimal(10,1));
2 changes: 2 additions & 0 deletions framework/resources/Functional/union/CastToSameDecimals.e_tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.000
596.000
3 changes: 3 additions & 0 deletions framework/resources/Functional/union/CastToSameDecimals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,3))
UNION
SELECT 596.000;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.000
596.000
3 changes: 3 additions & 0 deletions framework/resources/Functional/union/CastToThreeDecimals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,3))
UNION
SELECT cast(596.000 as decimal(10,3))
2 changes: 2 additions & 0 deletions framework/resources/Functional/union/IntegerAndVarchar.e_tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Awesome text
10.101
5 changes: 5 additions & 0 deletions framework/resources/Functional/union/IntegerAndVarchar.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT 'Awesome text'
UNION
SELECT 10.101
UNION
SELECT 10.101;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
10.100
20.120
30.123
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT 10.1
UNION
SELECT 20.12
UNION
SELECT 30.123;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
100.000
5 changes: 5 additions & 0 deletions framework/resources/Functional/union/ThreeCastsToDecimals.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT cast(100 as decimal(10,3))
UNION
SELECT cast(100 as decimal(10,2))
UNION
SELECT cast(100 as decimal(10,1));
2 changes: 2 additions & 0 deletions framework/resources/Functional/union/VarcharAndDate.e_tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2017-04-06
Awesome text
3 changes: 3 additions & 0 deletions framework/resources/Functional/union/VarcharAndDate.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT 'Awesome text'
UNION
SELECT date '2017-04-06';
2 changes: 2 additions & 0 deletions framework/resources/Functional/union/VarcharAndDecimal.e_tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
10.101
Awesome text
3 changes: 3 additions & 0 deletions framework/resources/Functional/union/VarcharAndDecimal.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT 'Awesome text'
UNION
SELECT 10.101;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2017-04-06
ABC
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT SUBSTRING('ABC some text', 1, 3) AS ExtractString
UNION
SELECT date '2017-04-06';
4 changes: 2 additions & 2 deletions framework/resources/Functional/union/queries.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
],
"matrices": [
{
"query-file": ".*.q",
"query-file": ".*.sql",
"schema": "dfs.union",
"output-format": "tsv",
"expected-file": ".*.e",
"expected-file": ".*.e_tsv",
"verification-type": [
"in-memory"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.000
596.000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,1))
UNION ALL
SELECT 596.000;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.0
596.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,1))
UNION ALL
SELECT cast(596.000 as decimal(10,1));
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.000
596.000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,3))
UNION ALL
SELECT 596.000;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1000.000
596.000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT cast(1000 as decimal(10,3))
UNION ALL
SELECT cast(596.000 as decimal(10,3))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Awesome text
10.101
10.101
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT 'Awesome text'
UNION ALL
SELECT 10.101
UNION ALL
SELECT 10.101;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
10.100
20.120
30.123
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT 10.1
UNION ALL
SELECT 20.12
UNION ALL
SELECT 30.123;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
100.000
100.000
100.000
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT cast(100 as decimal(10,3))
UNION ALL
SELECT cast(100 as decimal(10,2))
UNION ALL
SELECT cast(100 as decimal(10,1));
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2017-04-06
Awesome text
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT 'Awesome text'
UNION ALL
SELECT date '2017-04-06';
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
10.101
Awesome text
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT 'Awesome text'
UNION ALL
SELECT 10.101;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2017-04-06
ABC
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SELECT SUBSTRING('ABC some text', 1, 3) AS ExtractString
UNION ALL
SELECT date '2017-04-06';

0 comments on commit bd2d0f4

Please sign in to comment.