-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(test): reorganize over window e2e tests (#13186)
Signed-off-by: Richard Chien <[email protected]>
- Loading branch information
Showing
36 changed files
with
882 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../over_window/generated/batch/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
include ./special_cases/mod.slt.part | ||
include ./over_window/mod.slt.part | ||
include ./generated/main.slt.part |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
e2e_test/over_window/generated/batch/agg_in_win_func/mod.slt.part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
# Test aggregate function calls as window function args/PARTITION BY/ORDER BY. | ||
|
||
statement ok | ||
create table t ( | ||
id int | ||
, p1 int | ||
, p2 int | ||
, time int | ||
, v1 int | ||
, v2 int | ||
); | ||
|
||
statement ok | ||
create view v as | ||
select | ||
p1, p2 | ||
, row_number() over (partition by p1 order by p2) as out1 | ||
, sum(sum(v2)) over (partition by p1, avg(time) order by max(v1), p2) as out2 | ||
from t | ||
group by p1, p2; | ||
|
||
statement ok | ||
insert into t values | ||
(100001, 100, 200, 1, 701, 805) | ||
, (100002, 100, 200, 2, 700, 806) | ||
, (100003, 100, 208, 2, 723, 807) | ||
, (100004, 103, 200, 2, 702, 808); | ||
|
||
query iiii | ||
select * from v order by p1, p2; | ||
---- | ||
100 200 1 1611 | ||
100 208 2 807 | ||
103 200 1 808 | ||
|
||
statement ok | ||
insert into t values | ||
(100005, 100, 200, 3, 717, 810) | ||
, (100006, 105, 204, 5, 703, 828); | ||
|
||
query iiii | ||
select * from v order by p1, p2; | ||
---- | ||
100 200 1 2421 | ||
100 208 2 3228 | ||
103 200 1 808 | ||
105 204 1 828 | ||
|
||
statement ok | ||
update t set v1 = 799 where id = 100002; -- value change | ||
|
||
statement ok | ||
update t set p2 = 200 where id = 100003; -- partition change | ||
|
||
statement ok | ||
update t set "time" = 1 where id = 100005; -- order change | ||
|
||
query iiiiiii | ||
select * from v order by p1, p2; | ||
---- | ||
100 200 1 3228 | ||
103 200 1 808 | ||
105 204 1 828 | ||
|
||
statement ok | ||
delete from t where time = 2; | ||
|
||
query iiii | ||
select * from v order by p1, p2; | ||
---- | ||
100 200 1 1615 | ||
105 204 1 828 | ||
|
||
statement ok | ||
drop view v; | ||
|
||
statement ok | ||
drop table t; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
e2e_test/over_window/generated/batch/expr_in_win_func/mod.slt.part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
# Test expressions as window function args/PARTITION BY/ORDER BY. | ||
|
||
statement ok | ||
create table t ( | ||
id int | ||
, p1 int | ||
, p2 int | ||
, time int | ||
, v1 int | ||
, v2 int | ||
); | ||
|
||
statement ok | ||
create view v as | ||
select | ||
* | ||
, t.v2 as out1 | ||
, 0 as out2 | ||
, first_value(v1) over (partition by p1, p2 order by time, id rows 3 preceding) as out3 | ||
, lag(v1 + 2, 0 + 1) over (partition by p1 - 1 order by id) as out4 | ||
, min(v1 * 2) over (partition by p1, p2 order by time + 1, id rows between current row and unbounded following) as out5 | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(100001, 100, 200, 1, 701, 805) | ||
, (100002, 100, 200, 2, 700, 806) | ||
, (100003, 100, 208, 2, 723, 807) | ||
, (100004, 103, 200, 2, 702, 808); | ||
|
||
statement ok | ||
insert into t values | ||
(100005, 100, 200, 3, 717, 810) | ||
, (100006, 105, 204, 5, 703, 828); | ||
|
||
statement ok | ||
update t set v1 = 799 where id = 100002; -- value change | ||
|
||
statement ok | ||
update t set p2 = 200 where id = 100003; -- partition change | ||
|
||
statement ok | ||
update t set "time" = 1 where id = 100005; -- order change | ||
|
||
query iiiiiiiiii | ||
select * from v order by id; | ||
---- | ||
100001 100 200 1 701 805 805 0 701 NULL 1402 | ||
100002 100 200 2 799 806 806 0 701 703 1446 | ||
100003 100 200 2 723 807 807 0 701 801 1446 | ||
100004 103 200 2 702 808 808 0 702 NULL 1404 | ||
100005 100 200 1 717 810 810 0 701 725 1434 | ||
100006 105 204 5 703 828 828 0 703 NULL 1406 | ||
|
||
statement ok | ||
delete from t where time = 2; | ||
|
||
query iiiiiiiiii | ||
select * from v order by id; | ||
---- | ||
100001 100 200 1 701 805 805 0 701 NULL 1402 | ||
100005 100 200 1 717 810 810 0 701 703 1434 | ||
100006 105 204 5 703 828 828 0 703 NULL 1406 | ||
|
||
statement ok | ||
drop view v; | ||
|
||
statement ok | ||
drop table t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
include ./basic/mod.slt.part | ||
include ./rank_func/mod.slt.part | ||
include ./expr_in_win_func/mod.slt.part | ||
include ./agg_in_win_func/mod.slt.part | ||
include ./opt_agg_then_join/mod.slt.part |
Oops, something went wrong.