Skip to content

Commit

Permalink
Fix window function drill tests failures falling under RESULT_MISMATC…
Browse files Browse the repository at this point in the history
…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
sreemanamala authored Apr 12, 2024
1 parent cce2d0f commit 3340b20
Show file tree
Hide file tree
Showing 67 changed files with 475 additions and 315 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ enum Modes
BIGINT_TO_DATE(DruidException.class, "BIGINT to type (DATE|TIME)"),
NPE(DruidException.class, "java.lang.NullPointerException"),
AGGREGATION_NOT_SUPPORT_TYPE(DruidException.class, "Aggregation \\[(MIN|MAX)\\] does not support type \\[STRING\\]"),
RESULT_COUNT_MISMATCH(AssertionError.class, "result count:"),
ALLDATA_CSV(DruidException.class, "allData.csv"),
BIGINT_TIME_COMPARE(DruidException.class, "Cannot apply '.' to arguments of type"),
INCORRECT_SYNTAX(DruidException.class, "Incorrect syntax near the keyword"),
RESULT_MISMATCH(AssertionError.class, "(assertResulEquals|AssertionError: column content mismatch)"),
LONG_CASTING(AssertionError.class, "expected: java.lang.Long"),
UNSUPPORTED_NULL_ORDERING(DruidException.class, "(A|DE)SCENDING ordering with NULLS (LAST|FIRST)"),
WINDOW_OPERATOR_QUERY_ON_UNSUPPORTED_DATASOURCE(DruidException.class, "WindowOperatorQuery must run on top of a query or inline data source"),
UNION_WITH_COMPLEX_OPERAND(DruidException.class, "Only Table and Values are supported as inputs for Union"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19
2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6
3
Original file line number Diff line number Diff line change
@@ -1 +1 @@
214802204.95000000
186784527.47826087
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
23
Original file line number Diff line number Diff line change
@@ -1 +1 @@
186784043.04347826
107377466.50000000
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23
20
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
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
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
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
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'))
)
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'))
)
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'))
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'))
)
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'))
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'))
)
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SELECT *
FROM "t_alltype.parquet"
WINDOW W AS ( PARTITION BY c8 ORDER BY c1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING )
) subQry
WHERE subQry.w_min >= '1920-05-14'
WHERE subQry.w_min >= TIMESTAMP_TO_MILLIS(TIME_PARSE('1920-05-14', 'yyyy-MM-dd'))
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SELECT *
FROM "t_alltype.parquet"
WINDOW W AS ( PARTITION BY c8 ORDER BY c1 RANGE BETWEEN CURRENT ROW AND CURRENT ROW )
) subQry
WHERE subQry.w_min = '1912-02-01'
WHERE subQry.w_min = TIMESTAMP_TO_MILLIS(TIME_PARSE('1912-02-01', 'yyyy-MM-dd'))
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SELECT *
FROM "t_alltype.parquet"
WINDOW W AS ( PARTITION BY c8 ORDER BY c1 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING )
) subQry
WHERE subQry.sm > '1984-11-10'
WHERE subQry.sm > TIMESTAMP_TO_MILLIS(TIME_PARSE('1984-11-10', 'yyyy-MM-dd'))
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SELECT *
FROM "t_alltype.parquet"
WINDOW W AS ( PARTITION BY c8 ORDER BY c1 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW )
) subQry
WHERE subQry.w_max > '1992-11-11'
WHERE subQry.w_max > TIMESTAMP_TO_MILLIS(TIME_PARSE('1992-11-11', 'yyyy-MM-dd'))
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ SELECT *
FROM "t_alltype.parquet"
WINDOW W AS ( PARTITION BY c8 ORDER BY c1 RANGE BETWEEN CURRENT ROW AND CURRENT ROW )
) subQry
WHERE subQry.w_max > '1982-12-12'
WHERE subQry.w_max > TIMESTAMP_TO_MILLIS(TIME_PARSE('1982-12-12', 'yyyy-MM-dd'))
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'))
)
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'))
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'))
)
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'))
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'))
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'))
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
Loading

0 comments on commit 3340b20

Please sign in to comment.