File tree 40 files changed +4387
-4166
lines changed
bigquery/tests/unit/snapshots/test_compiler
test_range_window_function
test_trailing_range_window
impala/tests/snapshots/test_window
test_add_default_order_by
mssql/tests/snapshots/test_window/test_rank_no_window_frame
postgres/tests/snapshots/test_functions/test_analytic_functions
test_mixed_qualified_and_unqualified_predicates
test_rewrite_context/sqlite 40 files changed +4387
-4166
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,10 @@ jobs:
43
43
- " 3.12"
44
44
- " 3.13"
45
45
include :
46
- - os : ubuntu-latest
47
- python-version : " 3.9"
48
46
- os : ubuntu-latest
49
47
python-version : " 3.10"
50
48
- os : ubuntu-latest
51
49
python-version : " 3.11"
52
- - os : ubuntu-24.04-arm
53
- python-version : " 3.9"
54
50
- os : ubuntu-24.04-arm
55
51
python-version : " 3.10"
56
52
- os : ubuntu-24.04-arm
Original file line number Diff line number Diff line change @@ -45,14 +45,10 @@ jobs:
45
45
- " 3.12"
46
46
- " 3.13"
47
47
include :
48
- - os : ubuntu-latest
49
- python-version : " 3.9"
50
48
- os : ubuntu-latest
51
49
python-version : " 3.10"
52
50
- os : ubuntu-latest
53
51
python-version : " 3.11"
54
- - os : ubuntu-24.04-arm
55
- python-version : " 3.9"
56
52
- os : ubuntu-24.04-arm
57
53
python-version : " 3.10"
58
54
- os : ubuntu-24.04-arm
Original file line number Diff line number Diff line change 77
77
# pyspark
78
78
openjdk17_headless
79
79
# postgres client
80
+ libpq . pg_config
80
81
postgresql
81
82
# sqlite with readline
82
83
sqlite-interactive
160
161
packages = {
161
162
default = packages . ibis313 ;
162
163
163
- inherit ( pkgs ) ibis39 ibis310 ibis311 ibis312 ibis313
164
+ inherit ( pkgs ) ibis310 ibis311 ibis312 ibis313
164
165
update-lock-files check-release-notes-spelling ;
165
166
} ;
166
167
167
168
checks = {
168
- ibis39-pytest = pkgs . ibis39 . passthru . tests . pytest ;
169
169
ibis310-pytest = pkgs . ibis310 . passthru . tests . pytest ;
170
170
ibis311-pytest = pkgs . ibis311 . passthru . tests . pytest ;
171
171
ibis312-pytest = pkgs . ibis312 . passthru . tests . pytest ;
172
172
ibis313-pytest = pkgs . ibis313 . passthru . tests . pytest ;
173
173
} ;
174
174
175
175
devShells = rec {
176
- ibis39 = mkDevShell pkgs . ibisDevEnv39 ;
177
176
ibis310 = mkDevShell pkgs . ibisDevEnv310 ;
178
177
ibis311 = mkDevShell pkgs . ibisDevEnv311 ;
179
178
ibis312 = mkDevShell pkgs . ibisDevEnv312 ;
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (PARTITION BY ` t0` .` year` ORDER BY ` t0` .` month` ASC RANGE BETWEEN 1 preceding AND CURRENT ROW) AS ` two_month_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ PARTITION BY ` t0` .` year`
17
+ ORDER BY ` t0` .` month` ASC
18
+ RANGE BETWEEN 1 preceding AND CURRENT ROW
19
+ ) AS ` two_month_avg`
16
20
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (PARTITION BY ` t0` .` year` ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN 4 preceding AND 2 preceding) AS ` two_month_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ PARTITION BY ` t0` .` year`
17
+ ORDER BY ` t0` .` timestamp_col` ASC
18
+ RANGE BETWEEN 4 preceding AND 2 preceding
19
+ ) AS ` two_month_avg`
16
20
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL ' 1' DAY preceding AND INTERVAL 0 DAY following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL ' 1' DAY preceding AND INTERVAL 0 DAY following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL ' 1' HOUR preceding AND INTERVAL 0 HOUR following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL ' 1' HOUR preceding AND INTERVAL 0 HOUR following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL ' 1' MICROSECOND preceding AND INTERVAL 0 MICROSECOND following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL ' 1' MICROSECOND preceding AND INTERVAL 0 MICROSECOND following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL ' 1' MINUTE preceding AND INTERVAL 0 MINUTE following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL ' 1' MINUTE preceding AND INTERVAL 0 MINUTE following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL ' 1' SECOND preceding AND INTERVAL 0 SECOND following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL ' 1' SECOND preceding AND INTERVAL 0 SECOND following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL (EXTRACT(DAY FROM INTERVAL ' 1' DAY) * 2 ) DAY preceding AND INTERVAL 0 DAY following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL (EXTRACT(DAY FROM INTERVAL ' 1' DAY) * 2 ) DAY preceding AND INTERVAL 0 DAY following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (ORDER BY ` t0` .` timestamp_col` ASC RANGE BETWEEN INTERVAL ' 1' WEEK preceding AND INTERVAL 0 WEEK following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ ORDER BY ` t0` .` timestamp_col` ASC
17
+ RANGE BETWEEN INTERVAL ' 1' WEEK preceding AND INTERVAL 0 WEEK following
18
+ ) AS ` win_avg`
16
19
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (PARTITION BY ` t0` .` year` ORDER BY ` t0` .` timestamp_col` ASC ROWS BETWEEN CURRENT ROW AND 2 following) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ PARTITION BY ` t0` .` year`
17
+ ORDER BY ` t0` .` timestamp_col` ASC
18
+ ROWS BETWEEN CURRENT ROW AND 2 following
19
+ ) AS ` win_avg`
16
20
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (PARTITION BY ` t0` .` year` ORDER BY ` t0` .` timestamp_col` ASC ROWS BETWEEN 1 preceding AND CURRENT ROW) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ PARTITION BY ` t0` .` year`
17
+ ORDER BY ` t0` .` timestamp_col` ASC
18
+ ROWS BETWEEN 1 preceding AND CURRENT ROW
19
+ ) AS ` win_avg`
16
20
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change 12
12
` t0` .` timestamp_col` ,
13
13
` t0` .` year` ,
14
14
` t0` .` month` ,
15
- AVG (` t0` .` float_col` ) OVER (PARTITION BY ` t0` .` year` ORDER BY ` t0` .` timestamp_col` ASC ROWS BETWEEN 4 preceding AND 2 preceding) AS ` win_avg`
15
+ AVG (` t0` .` float_col` ) OVER (
16
+ PARTITION BY ` t0` .` year`
17
+ ORDER BY ` t0` .` timestamp_col` ASC
18
+ ROWS BETWEEN 4 preceding AND 2 preceding
19
+ ) AS ` win_avg`
16
20
FROM ` functional_alltypes` AS ` t0`
Original file line number Diff line number Diff line change @@ -12,7 +12,15 @@ SELECT
12
12
` t0` .` k` ,
13
13
LAG(` t0` .` f` ) OVER (PARTITION BY ` t0` .` g` ORDER BY NULL ASC ) AS ` lag` ,
14
14
LEAD(` t0` .` f` ) OVER (PARTITION BY ` t0` .` g` ORDER BY NULL ASC ) - ` t0` .` f` AS ` fwd_diff` ,
15
- FIRST_VALUE(` t0` .` f` ) OVER (PARTITION BY ` t0` .` g` ORDER BY NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ` first` ,
16
- LAST_VALUE(` t0` .` f` ) OVER (PARTITION BY ` t0` .` g` ORDER BY NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ` last` ,
15
+ FIRST_VALUE(` t0` .` f` ) OVER (
16
+ PARTITION BY ` t0` .` g`
17
+ ORDER BY NULL ASC
18
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
19
+ ) AS ` first` ,
20
+ LAST_VALUE(` t0` .` f` ) OVER (
21
+ PARTITION BY ` t0` .` g`
22
+ ORDER BY NULL ASC
23
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
24
+ ) AS ` last` ,
17
25
LAG(` t0` .` f` ) OVER (PARTITION BY ` t0` .` g` ORDER BY ` t0` .` d` ASC ) AS ` lag2`
18
26
FROM ` alltypes` AS ` t0`
Original file line number Diff line number Diff line change 1
1
SELECT
2
2
` t0` .` g` ,
3
- SUM (` t0` .` f` ) OVER (PARTITION BY ` t0` .` g` ORDER BY NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - SUM (` t0` .` f` ) OVER (ORDER BY NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ` result`
3
+ SUM (` t0` .` f` ) OVER (
4
+ PARTITION BY ` t0` .` g`
5
+ ORDER BY NULL ASC
6
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
7
+ ) - SUM (` t0` .` f` ) OVER (ORDER BY NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ` result`
4
8
FROM ` alltypes` AS ` t0`
Original file line number Diff line number Diff line change 1
1
SELECT
2
2
LAG(` t0` .` d` ) OVER (PARTITION BY ` t0` .` g` ORDER BY ` t0` .` f` DESC NULLS LAST) AS ` foo` ,
3
- MAX (` t0` .` a` ) OVER (PARTITION BY ` t0` .` g` ORDER BY ` t0` .` f` DESC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ` Max(a)`
3
+ MAX (` t0` .` a` ) OVER (
4
+ PARTITION BY ` t0` .` g`
5
+ ORDER BY ` t0` .` f` DESC NULLS LAST
6
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
7
+ ) AS ` Max(a)`
4
8
FROM ` alltypes` AS ` t0`
Original file line number Diff line number Diff line change 1
1
SELECT
2
2
[t0].[color],
3
3
[t0].[price],
4
- RANK() OVER (PARTITION BY [t0].[color] ORDER BY CASE WHEN [t0].[price] IS NULL THEN 1 ELSE 0 END, [t0].[price] ASC ) - 1 AS [MinRank()]
4
+ RANK() OVER (
5
+ PARTITION BY [t0].[color]
6
+ ORDER BY CASE WHEN [t0].[price] IS NULL THEN 1 ELSE 0 END, [t0].[price] ASC
7
+ ) - 1 AS [MinRank()]
5
8
FROM [diamonds_sample] AS [t0]
Original file line number Diff line number Diff line change 1
1
SELECT
2
- RANK() OVER (ORDER BY " t0" ." double_col" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS " rank" ,
3
- DENSE_RANK() OVER (ORDER BY " t0" ." double_col" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS " dense_rank" ,
4
- CUME_DIST() OVER (ORDER BY " t0" ." double_col" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS " cume_dist" ,
5
- NTILE(7 ) OVER (ORDER BY " t0" ." double_col" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS " ntile" ,
6
- PERCENT_RANK() OVER (ORDER BY " t0" ." double_col" ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS " percent_rank"
2
+ RANK() OVER (
3
+ ORDER BY " t0" ." double_col" ASC
4
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
5
+ ) - 1 AS " rank" ,
6
+ DENSE_RANK() OVER (
7
+ ORDER BY " t0" ." double_col" ASC
8
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
9
+ ) - 1 AS " dense_rank" ,
10
+ CUME_DIST() OVER (
11
+ ORDER BY " t0" ." double_col" ASC
12
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
13
+ ) AS " cume_dist" ,
14
+ NTILE(7 ) OVER (
15
+ ORDER BY " t0" ." double_col" ASC
16
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
17
+ ) - 1 AS " ntile" ,
18
+ PERCENT_RANK() OVER (
19
+ ORDER BY " t0" ." double_col" ASC
20
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
21
+ ) AS " percent_rank"
7
22
FROM " functional_alltypes" AS " t0"
Original file line number Diff line number Diff line change 5
5
SELECT
6
6
[t1].[x] AS [x],
7
7
[t1].[y] AS [y],
8
- AVG ([t1].[x]) OVER (ORDER BY CASE WHEN [t1].[x] IS NULL THEN 1 ELSE 0 END, [t1].[x] ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS _w
8
+ AVG ([t1].[x]) OVER (
9
+ ORDER BY CASE WHEN [t1].[x] IS NULL THEN 1 ELSE 0 END, [t1].[x] ASC
10
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
11
+ ) AS _w
9
12
FROM (
10
13
SELECT
11
14
[t0].[x],
12
- SUM ([t0].[x]) OVER (ORDER BY CASE WHEN [t0].[x] IS NULL THEN 1 ELSE 0 END, [t0].[x] ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS [y]
15
+ SUM ([t0].[x]) OVER (
16
+ ORDER BY CASE WHEN [t0].[x] IS NULL THEN 1 ELSE 0 END, [t0].[x] ASC
17
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
18
+ ) AS [y]
13
19
FROM [t] AS [t0]
14
20
) AS [t1]
15
21
WHERE
Original file line number Diff line number Diff line change 5
5
SELECT
6
6
` t1` .` x` ,
7
7
` t1` .` y` ,
8
- AVG (` t1` .` x` ) OVER (ORDER BY CASE WHEN NULL IS NULL THEN 1 ELSE 0 END, NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS _w
8
+ AVG (` t1` .` x` ) OVER (
9
+ ORDER BY CASE WHEN NULL IS NULL THEN 1 ELSE 0 END, NULL ASC
10
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
11
+ ) AS _w
9
12
FROM (
10
13
SELECT
11
14
` t0` .` x` ,
12
- SUM (` t0` .` x` ) OVER (ORDER BY CASE WHEN NULL IS NULL THEN 1 ELSE 0 END, NULL ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) AS ` y`
15
+ SUM (` t0` .` x` ) OVER (
16
+ ORDER BY CASE WHEN NULL IS NULL THEN 1 ELSE 0 END, NULL ASC
17
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
18
+ ) AS ` y`
13
19
FROM ` t` AS ` t0`
14
20
) AS ` t1`
15
21
WHERE
Original file line number Diff line number Diff line change 1
1
SELECT
2
- NTILE(2 ) OVER (ORDER BY 0 .5 + (
3
- CAST(RANDOM() AS REAL ) / - 1 .8446744073709552e+ 19
4
- ) ASC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) - 1 AS " new_col"
2
+ NTILE(2 ) OVER (
3
+ ORDER BY 0 .5 + (
4
+ CAST(RANDOM() AS REAL ) / - 1 .8446744073709552e+ 19
5
+ ) ASC NULLS LAST
6
+ ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
7
+ ) - 1 AS " new_col"
5
8
FROM " test" AS " t0"
6
9
LIMIT 10
You can’t perform that action at this time.
0 commit comments