Skip to content

Commit 06f54e9

Browse files
Window Functions: update snapshots for topK() behavior on ClickHouse >= 25.12
1 parent 8e140d5 commit 06f54e9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

window_functions/tests/aggregate_funcs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ def aggregate_funcs_over_rows_frame(self, func):
100100
):
101101
snapshot_name += "/version>=24.3"
102102

103+
if (
104+
(func.startswith("topK"))
105+
and check_clickhouse_version(">=25.12")(self)
106+
):
107+
snapshot_name += "/version>=25.12"
108+
103109
execute_query(
104110
f"""
105111
SELECT {func} OVER (ORDER BY salary, empno ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) AS func

window_functions/tests/snapshots/common.py.tests.x86_64.snapshot

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6221,3 +6221,31 @@ id time w
62216221
9 2020-01-01 00:00:09 35.281381288934696
62226222
"""
62236223

6224+
_window_functions_tests_aggregate_funcs_aggregate_funcs_over_rows_frame_func__topK_salary___version__25_12 = r"""
6225+
func
6226+
[6000]
6227+
[5200,6000]
6228+
[5200,6000]
6229+
[5200,5000,6000]
6230+
[5200,4800,6000,5000]
6231+
[5200,4800,4200,5000,6000,4500]
6232+
[5200,4800,3900,5000,6000,4200,4500]
6233+
[5200,4800,3500,5000,6000,4200,3900,4500]
6234+
[4800,5200,6000,5000]
6235+
[4800,5200,4500,6000,5000]
6236+
"""
6237+
6238+
_window_functions_tests_aggregate_funcs_aggregate_funcs_over_rows_frame_func__topKWeighted_salary__1___version__25_12 = r"""
6239+
func
6240+
[6000]
6241+
[5200,6000]
6242+
[5200,6000]
6243+
[5200,5000,6000]
6244+
[5200,4800,6000,5000]
6245+
[5200,4800,4200,5000,6000,4500]
6246+
[5200,4800,3900,5000,6000,4200,4500]
6247+
[5200,4800,3500,5000,6000,4200,3900,4500]
6248+
[4800,5200,6000,5000]
6249+
[4800,5200,4500,6000,5000]
6250+
"""
6251+

0 commit comments

Comments
 (0)