-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stream): temporal join support pk prefix join condition (#10627)
- Loading branch information
Showing
9 changed files
with
490 additions
and
112 deletions.
There are no files selected for viewing
File renamed without changes.
84 changes: 84 additions & 0 deletions
84
e2e_test/streaming/temporal_join/temporal_join_with_index.slt
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,84 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
create table stream(id1 int, a1 int, b1 int) APPEND ONLY; | ||
|
||
statement ok | ||
create table version(id2 int, a2 int, b2 int, primary key (id2)); | ||
|
||
statement ok | ||
create index idx on version (a2); | ||
|
||
statement ok | ||
create materialized view v as select id1, a1, id2, a2 from stream left join idx FOR SYSTEM_TIME AS OF PROCTIME() on b1 = b2 and a1 = a2; | ||
|
||
statement ok | ||
insert into stream values(1, 11, 111); | ||
|
||
statement ok | ||
insert into version values(1, 11, 111); | ||
|
||
statement ok | ||
insert into version values(9, 11, 111); | ||
|
||
statement ok | ||
insert into stream values(1, 11, 111); | ||
|
||
statement ok | ||
delete from version; | ||
|
||
query IIII rowsort | ||
select * from v; | ||
---- | ||
1 11 1 11 | ||
1 11 9 11 | ||
1 11 NULL NULL | ||
|
||
statement ok | ||
insert into version values(2, 22, 222); | ||
|
||
statement ok | ||
insert into stream values(2, 22, 222); | ||
|
||
statement ok | ||
insert into version values(8, 22, 222); | ||
|
||
statement ok | ||
insert into stream values(2, 22, 222); | ||
|
||
query IIII rowsort | ||
select * from v; | ||
---- | ||
1 11 1 11 | ||
1 11 9 11 | ||
1 11 NULL NULL | ||
2 22 2 22 | ||
2 22 2 22 | ||
2 22 8 22 | ||
|
||
statement ok | ||
update version set b2 = 333 where id2 = 2; | ||
|
||
statement ok | ||
insert into stream values(2, 22, 222); | ||
|
||
query IIII rowsort | ||
select * from v; | ||
---- | ||
1 11 1 11 | ||
1 11 9 11 | ||
1 11 NULL NULL | ||
2 22 2 22 | ||
2 22 2 22 | ||
2 22 8 22 | ||
2 22 8 22 | ||
|
||
statement ok | ||
drop materialized view v; | ||
|
||
statement ok | ||
drop table stream; | ||
|
||
statement ok | ||
drop table version; |
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
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.