Add window query test files from Drill (#14561)

This commit is contained in:
imply-cheddar 2023-07-13 12:14:39 +09:00 committed by GitHub
parent 0dcb19f7e3
commit 7650a71d37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2605 changed files with 1362642 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
2147483647

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
2147483647

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
214802204.95000000

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
2147483647

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
186784043.04347826

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
-1 e e 1

View File

@ -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

View File

@ -0,0 +1 @@
SELECT COUNT(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query

View File

@ -0,0 +1 @@
SELECT MAX(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query

View File

@ -0,0 +1 @@
SELECT COUNT(distinct tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query

View File

@ -0,0 +1 @@
SELECT MIN(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY col7 ORDER BY col1) tile FROM "allTypsUniq.parquet") sub_query

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
-65535

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
9223372036854775807

View File

@ -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

View File

@ -0,0 +1 @@
-65535

View File

@ -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

View File

@ -0,0 +1 @@
15 e e 2

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
9223372036854775807

View File

@ -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

View File

@ -0,0 +1 @@
9223372036854775806

View File

@ -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)

View File

@ -0,0 +1 @@
9223372036854775806

View File

@ -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)

View File

@ -0,0 +1 @@
9223372036854775807

View File

@ -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)

View File

@ -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

View File

@ -0,0 +1 @@
161564562.65000000

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
4611686018427387903

View File

@ -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

View File

@ -0,0 +1 @@
-65535

View File

@ -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

View File

@ -0,0 +1 @@
SELECT COUNT(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query

View File

@ -0,0 +1 @@
235195986941643711

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
SELECT MAX(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query

View File

@ -0,0 +1 @@
SELECT COUNT(distinct tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query

View File

@ -0,0 +1 @@
SELECT MIN(tile) FROM (SELECT NTILE(3) OVER(PARTITION BY c2 ORDER BY c1) tile FROM "tblWnulls.parquet") sub_query

View File

@ -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

View File

@ -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

View File

@ -0,0 +1 @@
select MAX(col_int) OVER() FROM "smlTbl.parquet"

View File

@ -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

View File

@ -0,0 +1 @@
select MIN(col_int) OVER() FROM "smlTbl.parquet"

View File

@ -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

View File

@ -0,0 +1 @@
select SUM(col_int) OVER() FROM "smlTbl.parquet"

View File

@ -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

View File

@ -0,0 +1 @@
select AVG(col_int) OVER() FROM "smlTbl.parquet"

View File

@ -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

View File

@ -0,0 +1 @@
select COUNT(col_int) OVER() FROM "smlTbl.parquet"

View File

@ -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;

View File

@ -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"
}
]
}

View File

@ -0,0 +1,4 @@
null c null
null d null
null d null
null null null

View File

@ -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