forked from apache/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix window function drill tests failures falling under RESULT_MISMATC…
…H & RESULT_COUNT_MISMATCH (apache#16264) * Updated the drill test expected results which are failing due to druid's default sorting algorithm taking nulls first approach. * Corrected the queries where date time values are directly provided * marked 2 cases failing with resultset casting issues
- Loading branch information
1 parent
cce2d0f
commit 3340b20
Showing
67 changed files
with
475 additions
and
315 deletions.
There are no files selected for viewing
69 changes: 2 additions & 67 deletions
69
sql/src/test/java/org/apache/druid/sql/calcite/DrillWindowQueryTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
2 changes: 1 addition & 1 deletion
2
sql/src/test/resources/drill/window/queries/aggregates/aggOWnFn_10.e
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
19 | ||
2 |
2 changes: 1 addition & 1 deletion
2
sql/src/test/resources/drill/window/queries/aggregates/aggOWnFn_12.e
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
6 | ||
3 |
2 changes: 1 addition & 1 deletion
2
sql/src/test/resources/drill/window/queries/aggregates/aggOWnFn_18.e
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
214802204.95000000 | ||
186784527.47826087 |
2 changes: 1 addition & 1 deletion
2
sql/src/test/resources/drill/window/queries/aggregates/aggOWnFn_19.e
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
20 | ||
23 |
2 changes: 1 addition & 1 deletion
2
sql/src/test/resources/drill/window/queries/aggregates/aggOWnFn_22.e
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
186784043.04347826 | ||
107377466.50000000 |
2 changes: 1 addition & 1 deletion
2
sql/src/test/resources/drill/window/queries/aggregates/aggOWnFn_23.e
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
23 | ||
20 |
4 changes: 1 addition & 3 deletions
4
sql/src/test/resources/drill/window/queries/aggregates/testW_Nulls_1.q
This file contains 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 |
---|---|---|
@@ -1,3 +1 @@ | ||
-- SELECT c1, c2, w_MAX FROM ( SELECT c1, c2, MAX ( c1 ) OVER ( PARTITION BY c2 ORDER BY c1 ASC) w_MAX FROM "tblWnulls.parquet" ) sub_query WHERE w_MAX IS null | ||
|
||
SELECT c1, c2, MAX ( c1 ) OVER ( PARTITION BY c2 ORDER BY c1 ASC) w_MAX FROM "tblWnulls.parquet" | ||
SELECT c1, c2, w_MAX FROM ( SELECT c1, c2, MAX ( c1 ) OVER ( PARTITION BY c2 ORDER BY c1 ASC) w_MAX FROM "tblWnulls.parquet" ) sub_query WHERE w_MAX IS null |
46 changes: 23 additions & 23 deletions
46
sql/src/test/resources/drill/window/queries/aggregates/winFnQry_83.e
This file contains 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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
11111 a 1 1 1 0.0 0.14285714285714285 | ||
11111 a 1 1 1 0 0.14285714285714285 | ||
14 a 2 2 2 0.16666666666666666 0.2857142857142857 | ||
11 a 3 3 3 0.3333333333333333 0.42857142857142855 | ||
10 a 4 4 4 0.5 0.5714285714285714 | ||
5 a 5 5 5 0.6666666666666666 0.7142857142857143 | ||
1 a 6 6 6 0.8333333333333334 0.8571428571428571 | ||
0 a 7 7 7 1.0 1.0 | ||
17 b 1 1 1 0.0 0.25 | ||
0 a 7 7 7 1 1 | ||
17 b 1 1 1 0 0.25 | ||
13 b 2 2 2 0.3333333333333333 0.5 | ||
9 b 3 3 3 0.6666666666666666 0.75 | ||
2 b 4 4 4 1.0 1.0 | ||
null c 1 1 1 0.0 0.14285714285714285 | ||
13 c 2 2 2 0.16666666666666666 0.42857142857142855 | ||
13 c 2 3 2 0.16666666666666666 0.42857142857142855 | ||
12 c 4 4 3 0.5 0.5714285714285714 | ||
8 c 5 5 4 0.6666666666666666 0.7142857142857143 | ||
6 c 6 6 5 0.8333333333333334 0.8571428571428571 | ||
4 c 7 7 6 1.0 1.0 | ||
null d 1 1 1 0.0 0.3333333333333333 | ||
null d 1 2 1 0.0 0.3333333333333333 | ||
2147483647 d 3 3 2 0.4 0.6666666666666666 | ||
2147483647 d 3 4 2 0.4 0.6666666666666666 | ||
11 d 5 5 3 0.8 0.8333333333333334 | ||
10 d 6 6 4 1.0 1.0 | ||
15 e 1 1 1 0.0 0.5 | ||
-1 e 2 2 2 1.0 1.0 | ||
null null 1 1 1 0.0 0.25 | ||
1000000 null 2 2 2 0.3333333333333333 0.5 | ||
65536 null 3 3 3 0.6666666666666666 0.75 | ||
19 null 4 4 4 1.0 1.0 | ||
2 b 4 4 4 1 1 | ||
13 c 1 1 1 0 0.2857142857142857 | ||
13 c 1 2 1 0 0.2857142857142857 | ||
12 c 3 3 2 0.3333333333333333 0.42857142857142855 | ||
8 c 4 4 3 0.5 0.5714285714285714 | ||
6 c 5 5 4 0.6666666666666666 0.7142857142857143 | ||
4 c 6 6 5 0.8333333333333334 0.8571428571428571 | ||
null c 7 7 6 1 1 | ||
2147483647 d 1 1 1 0 0.3333333333333333 | ||
2147483647 d 1 2 1 0 0.3333333333333333 | ||
11 d 3 3 2 0.4 0.5 | ||
10 d 4 4 3 0.6 0.6666666666666666 | ||
null d 5 5 4 0.8 1 | ||
null d 5 6 4 0.8 1 | ||
15 e 1 1 1 0 0.5 | ||
-1 e 2 2 2 1 1 | ||
1000000 null 1 1 1 0 0.25 | ||
65536 null 2 2 2 0.3333333333333333 0.5 | ||
19 null 3 3 3 0.6666666666666666 0.75 | ||
null null 4 4 4 1 1 |
46 changes: 23 additions & 23 deletions
46
sql/src/test/resources/drill/window/queries/aggregates/winFnQry_84.e
This file contains 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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
0 a 1 1 1 0.0 0.14285714285714285 | ||
0 a 1 1 1 0 0.14285714285714285 | ||
1 a 2 2 2 0.16666666666666666 0.2857142857142857 | ||
5 a 3 3 3 0.3333333333333333 0.42857142857142855 | ||
10 a 4 4 4 0.5 0.5714285714285714 | ||
11 a 5 5 5 0.6666666666666666 0.7142857142857143 | ||
14 a 6 6 6 0.8333333333333334 0.8571428571428571 | ||
11111 a 7 7 7 1.0 1.0 | ||
2 b 1 1 1 0.0 0.25 | ||
11111 a 7 7 7 1 1 | ||
2 b 1 1 1 0 0.25 | ||
9 b 2 2 2 0.3333333333333333 0.5 | ||
13 b 3 3 3 0.6666666666666666 0.75 | ||
17 b 4 4 4 1.0 1.0 | ||
4 c 1 1 1 0.0 0.14285714285714285 | ||
6 c 2 2 2 0.16666666666666666 0.2857142857142857 | ||
8 c 3 3 3 0.3333333333333333 0.42857142857142855 | ||
12 c 4 4 4 0.5 0.5714285714285714 | ||
13 c 5 5 5 0.6666666666666666 0.8571428571428571 | ||
13 c 5 6 5 0.6666666666666666 0.8571428571428571 | ||
null c 7 7 6 1.0 1.0 | ||
10 d 1 1 1 0.0 0.16666666666666666 | ||
11 d 2 2 2 0.2 0.3333333333333333 | ||
2147483647 d 3 3 3 0.4 0.6666666666666666 | ||
2147483647 d 3 4 3 0.4 0.6666666666666666 | ||
null d 5 5 4 0.8 1.0 | ||
null d 5 6 4 0.8 1.0 | ||
-1 e 1 1 1 0.0 0.5 | ||
15 e 2 2 2 1.0 1.0 | ||
19 null 1 1 1 0.0 0.25 | ||
65536 null 2 2 2 0.3333333333333333 0.5 | ||
1000000 null 3 3 3 0.6666666666666666 0.75 | ||
null null 4 4 4 1.0 1.0 | ||
17 b 4 4 4 1 1 | ||
null c 1 1 1 0 0.14285714285714285 | ||
4 c 2 2 2 0.16666666666666666 0.2857142857142857 | ||
6 c 3 3 3 0.3333333333333333 0.42857142857142855 | ||
8 c 4 4 4 0.5 0.5714285714285714 | ||
12 c 5 5 5 0.6666666666666666 0.7142857142857143 | ||
13 c 6 6 6 0.8333333333333334 1 | ||
13 c 6 7 6 0.8333333333333334 1 | ||
null d 1 1 1 0 0.3333333333333333 | ||
null d 1 2 1 0 0.3333333333333333 | ||
10 d 3 3 2 0.4 0.5 | ||
11 d 4 4 3 0.6 0.6666666666666666 | ||
2147483647 d 5 5 4 0.8 1 | ||
2147483647 d 5 6 4 0.8 1 | ||
-1 e 1 1 1 0 0.5 | ||
15 e 2 2 2 1 1 | ||
null null 1 1 1 0 0.25 | ||
19 null 2 2 2 0.3333333333333333 0.5 | ||
65536 null 3 3 3 0.6666666666666666 0.75 | ||
1000000 null 4 4 4 1 1 |
46 changes: 23 additions & 23 deletions
46
sql/src/test/resources/drill/window/queries/aggregates/winFnQry_85.e
This file contains 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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
0 a 1 1 1 0.0 0.14285714285714285 | ||
0 a 1 1 1 0 0.14285714285714285 | ||
1 a 2 2 2 0.16666666666666666 0.2857142857142857 | ||
5 a 3 3 3 0.3333333333333333 0.42857142857142855 | ||
10 a 4 4 4 0.5 0.5714285714285714 | ||
11 a 5 5 5 0.6666666666666666 0.7142857142857143 | ||
14 a 6 6 6 0.8333333333333334 0.8571428571428571 | ||
11111 a 7 7 7 1.0 1.0 | ||
2 b 1 1 1 0.0 0.25 | ||
11111 a 7 7 7 1 1 | ||
2 b 1 1 1 0 0.25 | ||
9 b 2 2 2 0.3333333333333333 0.5 | ||
13 b 3 3 3 0.6666666666666666 0.75 | ||
17 b 4 4 4 1.0 1.0 | ||
4 c 1 1 1 0.0 0.14285714285714285 | ||
6 c 2 2 2 0.16666666666666666 0.2857142857142857 | ||
8 c 3 3 3 0.3333333333333333 0.42857142857142855 | ||
12 c 4 4 4 0.5 0.5714285714285714 | ||
13 c 5 5 5 0.6666666666666666 0.8571428571428571 | ||
13 c 5 6 5 0.6666666666666666 0.8571428571428571 | ||
null c 7 7 6 1.0 1.0 | ||
10 d 1 1 1 0.0 0.16666666666666666 | ||
11 d 2 2 2 0.2 0.3333333333333333 | ||
2147483647 d 3 3 3 0.4 0.6666666666666666 | ||
2147483647 d 3 4 3 0.4 0.6666666666666666 | ||
null d 5 5 4 0.8 1.0 | ||
null d 5 6 4 0.8 1.0 | ||
-1 e 1 1 1 0.0 0.5 | ||
15 e 2 2 2 1.0 1.0 | ||
19 null 1 1 1 0.0 0.25 | ||
65536 null 2 2 2 0.3333333333333333 0.5 | ||
1000000 null 3 3 3 0.6666666666666666 0.75 | ||
null null 4 4 4 1.0 1.0 | ||
17 b 4 4 4 1 1 | ||
null c 1 1 1 0 0.14285714285714285 | ||
4 c 2 2 2 0.16666666666666666 0.2857142857142857 | ||
6 c 3 3 3 0.3333333333333333 0.42857142857142855 | ||
8 c 4 4 4 0.5 0.5714285714285714 | ||
12 c 5 5 5 0.6666666666666666 0.7142857142857143 | ||
13 c 6 6 6 0.8333333333333334 1 | ||
13 c 6 7 6 0.8333333333333334 1 | ||
null d 1 1 1 0 0.3333333333333333 | ||
null d 1 2 1 0 0.3333333333333333 | ||
10 d 3 3 2 0.4 0.5 | ||
11 d 4 4 3 0.6 0.6666666666666666 | ||
2147483647 d 5 5 4 0.8 1 | ||
2147483647 d 5 6 4 0.8 1 | ||
-1 e 1 1 1 0 0.5 | ||
15 e 2 2 2 1 1 | ||
null null 1 1 1 0 0.25 | ||
19 null 2 2 2 0.3333333333333333 0.5 | ||
65536 null 3 3 3 0.6666666666666666 0.75 | ||
1000000 null 4 4 4 1 1 |
12 changes: 11 additions & 1 deletion
12
sql/src/test/resources/drill/window/queries/first_val/firstValFn_18.q
This file contains 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 |
---|---|---|
@@ -1 +1,11 @@ | ||
SELECT col7 , col4, FIRST_VALUE(col4) OVER(PARTITION BY col7 ORDER BY col4) FIRST_VALUE_col4 FROM "allTypsUniq.parquet" WHERE col4 IN ('20:20:20.300' , '19:24:45.200' , '23:45:35.120' , '23:23:30.222' , '16:35:45.100' , '10:59:58.119' , '15:20:30.230') | ||
SELECT col7 , col4, FIRST_VALUE(col4) OVER(PARTITION BY col7 ORDER BY col4) FIRST_VALUE_col4 | ||
FROM "allTypsUniq.parquet" | ||
WHERE col4 IN ( | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('20:20:20.300', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('19:24:45.200', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('23:45:35.120', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('23:23:30.222', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('16:35:45.100', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('10:59:58.119', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('15:20:30.230', 'HH:mm:ss.SSS')) | ||
) |
12 changes: 11 additions & 1 deletion
12
sql/src/test/resources/drill/window/queries/first_val/firstValFn_19.q
This file contains 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 |
---|---|---|
@@ -1 +1,11 @@ | ||
SELECT col7 , col4, FIRST_VALUE(col4) OVER(PARTITION BY col7 ORDER BY col4) FIRST_VALUE_col4 FROM "allTypsUniq.parquet" WHERE col4 NOT IN ('20:20:20.300' , '19:24:45.200' , '23:45:35.120' , '23:23:30.222' , '16:35:45.100' , '10:59:58.119' , '15:20:30.230') | ||
SELECT col7 , col4, FIRST_VALUE(col4) OVER(PARTITION BY col7 ORDER BY col4) FIRST_VALUE_col4 | ||
FROM "allTypsUniq.parquet" | ||
WHERE col4 NOT IN ( | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('20:20:20.300', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('19:24:45.200', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('23:45:35.120', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('23:23:30.222', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('16:35:45.100', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('10:59:58.119', 'HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('15:20:30.230', 'HH:mm:ss.SSS')) | ||
) |
5 changes: 4 additions & 1 deletion
5
sql/src/test/resources/drill/window/queries/first_val/firstValFn_21.q
This file contains 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
SELECT col7 , col5, FIRST_VALUE(col5) OVER(PARTITION BY col7 ORDER BY col5) FIRST_VALUE_col5 FROM "allTypsUniq.parquet" WHERE col5 >= '1947-07-02 00:28:02.418' AND col5 < '2011-06-02 00:28:02.218' | ||
SELECT col7 , col5, FIRST_VALUE(col5) OVER(PARTITION BY col7 ORDER BY col5) FIRST_VALUE_col5 FROM "allTypsUniq.parquet" | ||
WHERE | ||
col5 >= TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-07-02 00:28:02.418', 'yyyy-MM-dd HH:mm:ss.SSS')) AND | ||
col5 < TIMESTAMP_TO_MILLIS(TIME_PARSE('2011-06-02 00:28:02.218', 'yyyy-MM-dd HH:mm:ss.SSS')) |
9 changes: 8 additions & 1 deletion
9
sql/src/test/resources/drill/window/queries/first_val/firstValFn_22.q
This file contains 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 |
---|---|---|
@@ -1 +1,8 @@ | ||
SELECT col7 , col5, FIRST_VALUE(col5) OVER(PARTITION BY col7 ORDER BY col5) FIRST_VALUE_col5 FROM "allTypsUniq.parquet" WHERE col5 IN ( '1947-07-02 00:28:02.418' , '2011-06-02 00:28:02.218' , '1950-08-02 00:28:02.111' , '2012-06-02 00:28:02.418' , '1985-04-02 00:28:02.638') | ||
SELECT col7 , col5, FIRST_VALUE(col5) OVER(PARTITION BY col7 ORDER BY col5) FIRST_VALUE_col5 FROM "allTypsUniq.parquet" | ||
WHERE col5 IN ( | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-07-02 00:28:02.418', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2011-06-02 00:28:02.218', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1950-08-02 00:28:02.111', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2012-06-02 00:28:02.418', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1985-04-02 00:28:02.638', 'yyyy-MM-dd HH:mm:ss.SSS')) | ||
) |
5 changes: 4 additions & 1 deletion
5
sql/src/test/resources/drill/window/queries/first_val/firstValFn_24.q
This file contains 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
SELECT col7 , col6, FIRST_VALUE(col6) OVER(PARTITION BY col7 ORDER BY col6) FIRST_VALUE_col6 FROM "allTypsUniq.parquet" WHERE col6 > '1947-05-12' AND col6 < '2007-10-01' | ||
SELECT col7 , col6, FIRST_VALUE(col6) OVER(PARTITION BY col7 ORDER BY col6) FIRST_VALUE_col6 FROM "allTypsUniq.parquet" | ||
WHERE | ||
col6 > TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-05-12', 'yyyy-MM-dd')) AND | ||
col6 < TIMESTAMP_TO_MILLIS(TIME_PARSE('2007-10-01', 'yyyy-MM-dd')) |
18 changes: 17 additions & 1 deletion
18
sql/src/test/resources/drill/window/queries/first_val/firstValFn_25.q
This file contains 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 |
---|---|---|
@@ -1 +1,17 @@ | ||
SELECT col7 , col6 , FIRST_VALUE(col6) OVER(PARTITION BY col7 ORDER BY col6) FIRST_VALUE_col6 FROM "allTypsUniq.parquet" WHERE col6 IN ('1952-08-14' , '1981-03-14' , '1947-05-12' , '1995-10-09' , '1968-02-03' , '1943-02-02' , '1957-12-10' , '2015-01-01' , '2013-01-03' , '1989-02-02' , '2007-10-01' , '1999-01-03' ) | ||
SELECT col7 , col6 , FIRST_VALUE(col6) OVER(PARTITION BY col7 ORDER BY col6) FIRST_VALUE_col6 | ||
FROM "allTypsUniq.parquet" | ||
WHERE | ||
col6 IN ( | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1952-08-14', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1981-03-14', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-05-12', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1995-10-09', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1968-02-03', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1943-02-02', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1957-12-10', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2015-01-01', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2013-01-03', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1989-02-02', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2007-10-01', 'yyyy-MM-dd')) , | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1999-01-03', 'yyyy-MM-dd')) | ||
) |
6 changes: 3 additions & 3 deletions
6
sql/src/test/resources/drill/window/queries/first_val/firstValFn_33.e
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
null null null null 1 null null | ||
19 null null null 1 null null | ||
65536 null null null 1 null null | ||
1000000 null null null 2 null null | ||
null null null null 3 null null | ||
65536 null null null 2 null null | ||
1000000 null null null 3 null null |
This file contains 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 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 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 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 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
9 changes: 8 additions & 1 deletion
9
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_100.q
This file contains 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 |
---|---|---|
@@ -1 +1,8 @@ | ||
SELECT col7 , col5, LAG(col5) OVER(PARTITION BY col7 ORDER BY col5) LAG_col5 FROM "allTypsUniq.parquet" WHERE col5 IN ( '1947-07-02 00:28:02.418' , '2011-06-02 00:28:02.218' , '1950-08-02 00:28:02.111' , '2012-06-02 00:28:02.418' , '1985-04-02 00:28:02.638') | ||
SELECT col7 , col5, LAG(col5) OVER(PARTITION BY col7 ORDER BY col5) LAG_col5 FROM "allTypsUniq.parquet" | ||
WHERE col5 IN ( | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-07-02 00:28:02.418', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2011-06-02 00:28:02.218', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1950-08-02 00:28:02.111', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2012-06-02 00:28:02.418', 'yyyy-MM-dd HH:mm:ss.SSS')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1985-04-02 00:28:02.638', 'yyyy-MM-dd HH:mm:ss.SSS')) | ||
) |
6 changes: 5 additions & 1 deletion
6
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_102.q
This file contains 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
SELECT col7 , col6, LAG(col6) OVER(PARTITION BY col7 ORDER BY col6) LAG_col6 FROM "allTypsUniq.parquet" WHERE col6 > '1947-05-12' and col6 < '2007-10-01' | ||
SELECT col7 , col6, LAG(col6) OVER(PARTITION BY col7 ORDER BY col6) LAG_col6 | ||
FROM "allTypsUniq.parquet" | ||
WHERE | ||
col6 > TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-05-12', 'yyyy-MM-dd')) and | ||
col6 < TIMESTAMP_TO_MILLIS(TIME_PARSE('2007-10-01', 'yyyy-MM-dd')) |
17 changes: 16 additions & 1 deletion
17
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_103.q
This file contains 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 |
---|---|---|
@@ -1 +1,16 @@ | ||
SELECT col7 , col6 , LAG(col6) OVER(PARTITION BY col7 ORDER BY col6) LAG_col6 FROM "allTypsUniq.parquet" WHERE col6 IN ('1952-08-14' , '1981-03-14' , '1947-05-12' , '1995-10-09' , '1968-02-03' , '1943-02-02' , '1957-12-10' , '2015-01-01' , '2013-01-03' , '1989-02-02' , '2007-10-01' , '1999-01-03' ) | ||
SELECT col7 , col6 , LAG(col6) OVER(PARTITION BY col7 ORDER BY col6) LAG_col6 | ||
FROM "allTypsUniq.parquet" | ||
WHERE col6 IN ( | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1952-08-14', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1981-03-14', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1947-05-12', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1995-10-09', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1968-02-03', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1943-02-02', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1957-12-10', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2015-01-01', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2013-01-03', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1989-02-02', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('2007-10-01', 'yyyy-MM-dd')), | ||
TIMESTAMP_TO_MILLIS(TIME_PARSE('1999-01-03', 'yyyy-MM-dd')) | ||
) |
4 changes: 3 additions & 1 deletion
4
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_41.q
This file contains 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
SELECT col4 , LAG(col4) OVER (ORDER BY col4) LAG_col4 FROM "fewRowsAllData.parquet" WHERE col4 < '2012-06-02 00:28:02.433' | ||
SELECT col4 , LAG(col4) OVER (ORDER BY col4) LAG_col4 | ||
FROM "fewRowsAllData.parquet" | ||
WHERE col4 < TIMESTAMP_TO_MILLIS(TIME_PARSE('2012-06-02 00:28:02.433', 'yyyy-MM-dd HH:mm:ss.SSS')) |
4 changes: 3 additions & 1 deletion
4
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_42.q
This file contains 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
SELECT col5 , LAG(col5) OVER (ORDER BY col5) LAG_col5 FROM "fewRowsAllData.parquet" WHERE col5 < '1968-06-06' | ||
SELECT col5 , LAG(col5) OVER (ORDER BY col5) LAG_col5 | ||
FROM "fewRowsAllData.parquet" | ||
WHERE col5 < TIMESTAMP_TO_MILLIS(TIME_PARSE('1968-06-06', 'yyyy-MM-dd')) |
4 changes: 3 additions & 1 deletion
4
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_45.q
This file contains 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
SELECT col8 , LAG(col8) OVER (ORDER BY col8 ) LAG_col8 FROM "fewRowsAllData.parquet" WHERE col8 < '07:10:06.550' | ||
SELECT col8 , LAG(col8) OVER (ORDER BY col8 ) LAG_col8 | ||
FROM "fewRowsAllData.parquet" | ||
WHERE col8 < TIMESTAMP_TO_MILLIS(TIME_PARSE('07:10:06.550', 'HH:mm:ss.SSS')) |
7 changes: 6 additions & 1 deletion
7
sql/src/test/resources/drill/window/queries/lag_func/lag_Fn_63.q
This file contains 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 |
---|---|---|
@@ -1 +1,6 @@ | ||
SELECT c8 , LAG(c8) OVER( PARTITION BY c2 ORDER BY c8 ) LAG_c8 FROM ( SELECT col8 c8, col1 c1, col2 c2 FROM "fewRowsAllData.parquet" WHERE col8 < '07:10:06.550' ORDER BY col8) sub_query | ||
SELECT c8 , LAG(c8) OVER( PARTITION BY c2 ORDER BY c8 ) LAG_c8 | ||
FROM ( | ||
SELECT col8 c8, col1 c1, col2 c2 FROM "fewRowsAllData.parquet" | ||
WHERE col8 < TIMESTAMP_TO_MILLIS(TIME_PARSE('07:10:06.550', 'HH:mm:ss.SSS')) | ||
ORDER BY col8 | ||
) sub_query |
Oops, something went wrong.