-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(over window): pass through
Update
s not affecting window functi…
…on outputs (#19056) Signed-off-by: Richard Chien <[email protected]>
- Loading branch information
Showing
10 changed files
with
384 additions
and
26 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
94 changes: 94 additions & 0 deletions
94
e2e_test/over_window/generated/batch/no_effect_updates/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,94 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
# Test handling of updates having no effect on window function outputs. | ||
|
||
statement ok | ||
create table t ( | ||
id int | ||
, foo int | ||
, bar int | ||
); | ||
|
||
statement ok | ||
create view v1 as | ||
select | ||
* | ||
, rank() over (partition by 1::int order by foo) as r1 | ||
from t; | ||
|
||
statement ok | ||
create view v2 as | ||
select | ||
* | ||
, rank() over (partition by 1::int order by bar) as r2 | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(100001, 701, 805) | ||
, (100002, 700, 806) | ||
, (100003, 723, 807) | ||
, (100004, 702, 808); | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100001 701 805 2 | ||
100004 702 808 3 | ||
100003 723 807 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 701 805 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
update t set foo = 733 where id = 100001; | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100004 702 808 2 | ||
100003 723 807 3 | ||
100001 733 805 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 733 805 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
update t set bar = 804 where id = 100001; | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100004 702 808 2 | ||
100003 723 807 3 | ||
100001 733 804 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 733 804 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
drop view v1; | ||
|
||
statement ok | ||
drop view v2; | ||
|
||
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
94 changes: 94 additions & 0 deletions
94
e2e_test/over_window/generated/streaming/no_effect_updates/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,94 @@ | ||
# This file is generated by `gen.py`. Do not edit it manually! | ||
|
||
# Test handling of updates having no effect on window function outputs. | ||
|
||
statement ok | ||
create table t ( | ||
id int | ||
, foo int | ||
, bar int | ||
); | ||
|
||
statement ok | ||
create materialized view v1 as | ||
select | ||
* | ||
, rank() over (partition by 1::int order by foo) as r1 | ||
from t; | ||
|
||
statement ok | ||
create materialized view v2 as | ||
select | ||
* | ||
, rank() over (partition by 1::int order by bar) as r2 | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(100001, 701, 805) | ||
, (100002, 700, 806) | ||
, (100003, 723, 807) | ||
, (100004, 702, 808); | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100001 701 805 2 | ||
100004 702 808 3 | ||
100003 723 807 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 701 805 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
update t set foo = 733 where id = 100001; | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100004 702 808 2 | ||
100003 723 807 3 | ||
100001 733 805 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 733 805 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
update t set bar = 804 where id = 100001; | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100004 702 808 2 | ||
100003 723 807 3 | ||
100001 733 804 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 733 804 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
drop materialized view v1; | ||
|
||
statement ok | ||
drop materialized view v2; | ||
|
||
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
92 changes: 92 additions & 0 deletions
92
e2e_test/over_window/templates/no_effect_updates/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,92 @@ | ||
# Test handling of updates having no effect on window function outputs. | ||
|
||
statement ok | ||
create table t ( | ||
id int | ||
, foo int | ||
, bar int | ||
); | ||
|
||
statement ok | ||
create $view_type v1 as | ||
select | ||
* | ||
, rank() over (partition by 1::int order by foo) as r1 | ||
from t; | ||
|
||
statement ok | ||
create $view_type v2 as | ||
select | ||
* | ||
, rank() over (partition by 1::int order by bar) as r2 | ||
from t; | ||
|
||
statement ok | ||
insert into t values | ||
(100001, 701, 805) | ||
, (100002, 700, 806) | ||
, (100003, 723, 807) | ||
, (100004, 702, 808); | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100001 701 805 2 | ||
100004 702 808 3 | ||
100003 723 807 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 701 805 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
update t set foo = 733 where id = 100001; | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100004 702 808 2 | ||
100003 723 807 3 | ||
100001 733 805 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 733 805 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
update t set bar = 804 where id = 100001; | ||
|
||
query iii | ||
select * from v1 order by r1, id; | ||
---- | ||
100002 700 806 1 | ||
100004 702 808 2 | ||
100003 723 807 3 | ||
100001 733 804 4 | ||
|
||
query iii | ||
select * from v2 order by r2, id; | ||
---- | ||
100001 733 804 1 | ||
100002 700 806 2 | ||
100003 723 807 3 | ||
100004 702 808 4 | ||
|
||
statement ok | ||
drop $view_type v1; | ||
|
||
statement ok | ||
drop $view_type v2; | ||
|
||
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
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
Oops, something went wrong.