mirror of https://github.com/apache/druid.git
Add window query test files from Drill (#14561)
This commit is contained in:
parent
0dcb19f7e3
commit
7650a71d37
|
@ -0,0 +1 @@
|
|||
19
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(firstVal_c1) FROM (SELECT FIRST_VALUE(c1) OVER(PARTITION BY c2 ORDER BY c1) firstVal_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-1
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(firstVal_c1) FROM (SELECT FIRST_VALUE(c1) OVER(PARTITION BY c2 ORDER BY c1) firstVal_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
6
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(distinct firstVal_c1) FROM (SELECT FIRST_VALUE(c1) OVER(PARTITION BY c2 ORDER BY c1) firstVal_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
2147483647
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lastVal_c1) FROM (SELECT LAST_VALUE(c1) OVER(PARTITION BY c2 ORDER BY c1) lastVal_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-1
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(lastVal_c1) FROM (SELECT LAST_VALUE(c1) OVER(PARTITION BY c2 ORDER BY c1) lastVal_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
21
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(distinct lastVal_c1) FROM (SELECT LAST_VALUE(c1) OVER(PARTITION BY c2 ORDER BY c1) lastVal_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
2147483647
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(LEAD_c1) FROM (SELECT LEAD(c1) OVER(PARTITION BY c2 ORDER BY c1) LEAD_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(LEAD_c1) FROM (SELECT LEAD(c1) OVER(PARTITION BY c2 ORDER BY c1) LEAD_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
214802204.95000000
|
|
@ -0,0 +1 @@
|
|||
SELECT AVG(LEAD_c1) FROM (SELECT LEAD(c1) OVER(PARTITION BY c2 ORDER BY c1) LEAD_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
20
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(LEAD_c1) FROM (SELECT LEAD(c1) OVER(PARTITION BY c2 ORDER BY c1) LEAD_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
2147483647
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lag_c1) FROM (SELECT LAG(c1) OVER(PARTITION BY c2 ORDER BY c1) lag_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-1
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(lag_c1) FROM (SELECT LAG(c1) OVER(PARTITION BY c2 ORDER BY c1) lag_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
186784043.04347826
|
|
@ -0,0 +1 @@
|
|||
SELECT AVG(lag_c1) FROM (SELECT LAG(c1) OVER(PARTITION BY c2 ORDER BY c1) lag_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
23
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(lag_c1) FROM (SELECT LAG(c1) OVER(PARTITION BY c2 ORDER BY c1) lag_c1 , c2 FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-1 e e 1
|
|
@ -0,0 +1 @@
|
|||
SELECT * FROM (SELECT c1, c2, LEAD(c2) OVER ( PARTITION BY c2 ORDER BY c1) LEAD_c2, NTILE(3) OVER ( PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query WHERE LEAD_c2 ="e" ORDER BY tile, c1
|
|
@ -0,0 +1 @@
|
|||
22
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(distinct tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query HAVING MAX(tile) > 2
|
|
@ -0,0 +1 @@
|
|||
-1
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(firstVal_col1) FROM (SELECT FIRST_VALUE(col1) OVER(PARTITION BY col7 ORDER BY col1) firstVal_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-65535
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(firstVal_col1) FROM (SELECT FIRST_VALUE(col1) OVER(PARTITION BY col7 ORDER BY col1) firstVal_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
2
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(distinct firstVal_col1) FROM (SELECT FIRST_VALUE(col1) OVER(PARTITION BY col7 ORDER BY col1) firstVal_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
9223372036854775807
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lastVal_col1) FROM (SELECT LAST_VALUE(col1) OVER(PARTITION BY col7 ORDER BY col1) lastVal_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-65535
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(lastVal_col1) FROM (SELECT LAST_VALUE(col1) OVER(PARTITION BY col7 ORDER BY col1) lastVal_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
15 e e 2
|
|
@ -0,0 +1 @@
|
|||
SELECT * FROM (SELECT c1, c2, lag(c2) OVER ( PARTITION BY c2 ORDER BY c1) lag_c2, NTILE(3) OVER ( PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query WHERE lag_c2 = "e" ORDER BY tile, c1
|
|
@ -0,0 +1 @@
|
|||
22
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(distinct lastVal_col1) FROM (SELECT LAST_VALUE(col1) OVER(PARTITION BY col7 ORDER BY col1) lastVal_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
9223372036854775807
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lead_col1) FROM (SELECT LEAD(col1) OVER(PARTITION BY col7 ORDER BY col1) lead_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
9223372036854775806
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lead_col1) FROM (SELECT col1, LEAD(col1) OVER(PARTITION BY col7 ORDER BY col1) lead_col1 , col7 FROM "allTypsUniq.parquet") sub_query WHERE col1 NOT IN (-1,0,1,-65535,10000000) AND col7 NOT IN (false)
|
|
@ -0,0 +1 @@
|
|||
9223372036854775806
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lead_col1) FROM (SELECT col1, LEAD(col1) OVER(PARTITION BY col7 ORDER BY col1) lead_col1 , col7 FROM "allTypsUniq.parquet") sub_query WHERE col7 NOT IN (false)
|
|
@ -0,0 +1 @@
|
|||
9223372036854775807
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lead_col1) FROM (SELECT col1, LEAD(col1) OVER(PARTITION BY col7 ORDER BY col1) lead_col1 , col7 FROM "allTypsUniq.parquet") sub_query WHERE col7 NOT IN (true)
|
|
@ -0,0 +1 @@
|
|||
0
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(lead_col1) FROM (SELECT LEAD(col1) OVER(PARTITION BY col7 ORDER BY col1) lead_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
161564562.65000000
|
|
@ -0,0 +1 @@
|
|||
SELECT AVG(lead_col0) FROM (SELECT LEAD(col0) OVER(PARTITION BY col7 ORDER BY col0) lead_col0 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
20
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(lead_col1) FROM (SELECT LEAD(col1) OVER(PARTITION BY col7 ORDER BY col1) lead_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
4611686018427387903
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(lag_col1) FROM (SELECT LAG(col1) OVER(PARTITION BY col7 ORDER BY col1) lag_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
-65535
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(lag_col1) FROM (SELECT LAG(col1) OVER(PARTITION BY col7 ORDER BY col1) lag_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
30
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
235195986941643711
|
|
@ -0,0 +1 @@
|
|||
SELECT AVG(lag_col1) FROM (SELECT LAG(col1) OVER(PARTITION BY col7 ORDER BY col1) lag_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
20
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(lag_col1) FROM (SELECT LAG(col1) OVER(PARTITION BY col7 ORDER BY col1) lag_col1 , col7 FROM "allTypsUniq.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
SELECT COUNT(distinct tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
1
|
|
@ -0,0 +1 @@
|
|||
SELECT MIN(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query
|
|
@ -0,0 +1 @@
|
|||
3
|
|
@ -0,0 +1 @@
|
|||
SELECT MAX(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query HAVING MAX(tile) > 2
|
|
@ -0,0 +1,56 @@
|
|||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
||||
407024
|
|
@ -0,0 +1 @@
|
|||
select MAX(col_int) OVER() FROM "smlTbl.parquet"
|
|
@ -0,0 +1,56 @@
|
|||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
||||
-199048
|
|
@ -0,0 +1 @@
|
|||
select MIN(col_int) OVER() FROM "smlTbl.parquet"
|
|
@ -0,0 +1,56 @@
|
|||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
||||
427349
|
|
@ -0,0 +1 @@
|
|||
select SUM(col_int) OVER() FROM "smlTbl.parquet"
|
|
@ -0,0 +1,56 @@
|
|||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
||||
7631.2321428571428571
|
|
@ -0,0 +1 @@
|
|||
select AVG(col_int) OVER() FROM "smlTbl.parquet"
|
|
@ -0,0 +1,56 @@
|
|||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
||||
56
|
|
@ -0,0 +1 @@
|
|||
select COUNT(col_int) OVER() FROM "smlTbl.parquet"
|
|
@ -0,0 +1 @@
|
|||
select col_int, count(*) OVER (PARTITION BY col_bln ORDER BY col_int,col_bln NULLS first) FROM (select * from `typeall_l` ORDER BY col_int LIMIT 64 OFFSET 64) subqry;
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"testId": "wind_fn_aggregates",
|
||||
"type": "group",
|
||||
"description": "Functional tests to verify Window Functions",
|
||||
"submit-type": "jdbc",
|
||||
"categories": [
|
||||
"functional"
|
||||
],
|
||||
"matrices": [
|
||||
{
|
||||
"query-file": ".*.q",
|
||||
"schema": "dfs.window_functions",
|
||||
"output-format": "tsv",
|
||||
"expected-file": ".*.e",
|
||||
"verification-type": [
|
||||
"in-memory"
|
||||
]
|
||||
}
|
||||
],
|
||||
"datasources": [
|
||||
{
|
||||
"mode": "cp",
|
||||
"src": "Datasources/window_functions",
|
||||
"dest": "window_functions"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
null c null
|
||||
null d null
|
||||
null d null
|
||||
null null null
|
|
@ -0,0 +1,3 @@
|
|||
-- 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"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue