Skip to content

Commit 538c8f4

Browse files
committed
add more planner tests
Signed-off-by: Richard Chien <[email protected]>
1 parent 7161a15 commit 538c8f4

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

src/frontend/planner_test/tests/testdata/input/over_window_function.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -570,3 +570,24 @@
570570
- optimized_logical_plan_for_stream
571571
- stream_error
572572
- batch_error
573+
- sql: |
574+
create table t (i int, bi bigint, d decimal, f float, da date, t time, ts timestamp, tstz timestamptz, itv interval);
575+
select
576+
count(*) over (partition by 1::int order by da range '1 day' preceding) -- `date` not supported yet
577+
from t;
578+
expected_outputs:
579+
- binder_error
580+
- sql: |
581+
create table t (i int, bi bigint, d decimal, f float, da date, t time, ts timestamp, tstz timestamptz, itv interval);
582+
select
583+
count(*) over (partition by 1::int order by t range '1 min' preceding) -- `time` not supported yet
584+
from t;
585+
expected_outputs:
586+
- binder_error
587+
- sql: |
588+
create table t (i int, bi bigint, d decimal, f float, da date, t time, ts timestamp, tstz timestamptz, itv interval);
589+
select
590+
count(*) over (partition by 1::int order by tstz range '1 day 1 hour' preceding) -- `timestamptz` +/- 'x month x day' not supported yet
591+
from t;
592+
expected_outputs:
593+
- binder_error

src/frontend/planner_test/tests/testdata/output/over_window_function.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -1163,3 +1163,36 @@
11631163
stream_error: |-
11641164
Feature is not yet implemented: Window function with `RANGE` frame is not supported yet
11651165
No tracking issue yet. Feel free to submit a feature request at https://github.com/risingwavelabs/risingwave/issues/new?labels=type%2Ffeature&template=feature_request.yml
1166+
- sql: |
1167+
create table t (i int, bi bigint, d decimal, f float, da date, t time, ts timestamp, tstz timestamptz, itv interval);
1168+
select
1169+
count(*) over (partition by 1::int order by da range '1 day' preceding) -- `date` not supported yet
1170+
from t;
1171+
binder_error: |
1172+
Failed to bind expression: count(*) OVER (PARTITION BY CAST(1 AS INT) ORDER BY da RANGE '1 day' PRECEDING)
1173+
1174+
Caused by:
1175+
Feature is not yet implemented: `RANGE` frame with offset of type `date` is not implemented yet, please manually cast the `ORDER BY` column to `timestamp`
1176+
No tracking issue yet. Feel free to submit a feature request at https://github.com/risingwavelabs/risingwave/issues/new?labels=type%2Ffeature&template=feature_request.yml
1177+
- sql: |
1178+
create table t (i int, bi bigint, d decimal, f float, da date, t time, ts timestamp, tstz timestamptz, itv interval);
1179+
select
1180+
count(*) over (partition by 1::int order by t range '1 min' preceding) -- `time` not supported yet
1181+
from t;
1182+
binder_error: |
1183+
Failed to bind expression: count(*) OVER (PARTITION BY CAST(1 AS INT) ORDER BY t RANGE '1 min' PRECEDING)
1184+
1185+
Caused by:
1186+
Feature is not yet implemented: `RANGE` frame with offset of type `time without time zone` is not implemented yet, please manually cast the `ORDER BY` column to `timestamp`
1187+
No tracking issue yet. Feel free to submit a feature request at https://github.com/risingwavelabs/risingwave/issues/new?labels=type%2Ffeature&template=feature_request.yml
1188+
- sql: |
1189+
create table t (i int, bi bigint, d decimal, f float, da date, t time, ts timestamp, tstz timestamptz, itv interval);
1190+
select
1191+
count(*) over (partition by 1::int order by tstz range '1 day 1 hour' preceding) -- `timestamptz` +/- 'x month x day' not supported yet
1192+
from t;
1193+
binder_error: |
1194+
Failed to bind expression: count(*) OVER (PARTITION BY CAST(1 AS INT) ORDER BY tstz RANGE '1 day 1 hour' PRECEDING)
1195+
1196+
Caused by these errors (recent errors listed first):
1197+
1: Expr error
1198+
2: for frame order column of type `timestamptz`, offset should not have non-zero `month` and `day`

0 commit comments

Comments
 (0)