-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(frontend): migrate mv on mv e2e tests (#1338)
Signed-off-by: Alex Chi <iskyzh@gmail.com>
- Loading branch information
Showing
18 changed files
with
447 additions
and
112 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
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,282 @@ | ||
control sortmode rowsort | ||
|
||
statement ok | ||
create table t1(v1 int not null, v2 int not null); | ||
|
||
statement ok | ||
create table t2(v1 real not null, v2 int not null, v3 real not null); | ||
|
||
statement ok | ||
create materialized view m1 as select v1, v2 from t1 where v1 = 1; | ||
|
||
statement ok | ||
create materialized view m2 as select v1, v2 from t1 where v2 = 1; | ||
|
||
statement ok | ||
create materialized view m3 as select sum(m1.v1) as sum_m1_v1, sum(m1.v2) as sum_m1_v2 from m1; | ||
|
||
statement ok | ||
create materialized view m4 as select m1.v1 as m1v1, m1.v2 as m1v2, m2.v1 as m2v1, m2.v2 as m2v2 from m1 join m2 on m1.v1 = m2.v1; | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
insert into t1 values (2,1),(1,2),(1,1); | ||
|
||
statement ok | ||
flush; | ||
|
||
query II | ||
select v1, v2 from t1; | ||
---- | ||
2 1 | ||
1 2 | ||
1 1 | ||
|
||
query II | ||
select v1, v2 from m1; | ||
---- | ||
1 2 | ||
1 1 | ||
|
||
query II | ||
select v1, v2 from m2; | ||
---- | ||
2 1 | ||
1 1 | ||
|
||
query II | ||
select sum_m1_v1, sum_m1_v2 from m3; | ||
---- | ||
2 3 | ||
|
||
query IIII | ||
select m1v1, m1v2, m2v1, m2v2 from m4; | ||
---- | ||
1 2 1 1 | ||
1 1 1 1 | ||
|
||
statement ok | ||
create materialized view m5 as select m1.v1 as m1v1, m1.v2 as m1v2, m2.v1 as m2v1, m2.v2 as m2v2 from m1 join m2 on m1.v1 = m2.v1; | ||
|
||
statement ok | ||
flush; | ||
|
||
query IIII | ||
select m1v1, m1v2, m2v1, m2v2 from m5; | ||
---- | ||
1 2 1 1 | ||
1 1 1 1 | ||
|
||
statement ok | ||
insert into t1 values (3,1),(1,3); | ||
|
||
statement ok | ||
flush; | ||
|
||
query IIII | ||
select m1v1, m1v2, m2v1, m2v2 from m5; | ||
---- | ||
1 2 1 1 | ||
1 1 1 1 | ||
1 3 1 1 | ||
|
||
statement ok | ||
create materialized view m6 as select v2, v3, v1 from t2; | ||
|
||
statement ok | ||
create materialized view m7 as select sum(v1) as sum_v1, avg(v3) as avg_v3 from m6 group by v1; | ||
|
||
statement ok | ||
create materialized view m8 as select sum(v1) as sum_v1 from m6 group by v2; | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
insert into t2 values (1,2,3),(1,5,6),(3,2,6); | ||
|
||
statement ok | ||
flush; | ||
|
||
query III | ||
select v1, v2, v3 from t2; | ||
---- | ||
1 2 3 | ||
1 5 6 | ||
3 2 6 | ||
|
||
query III | ||
select v2, v3, v1 from m6; | ||
---- | ||
2 3 1 | ||
5 6 1 | ||
2 6 3 | ||
|
||
query II | ||
select sum_v1, avg_v3 from m7; | ||
---- | ||
2 4.5 | ||
3 6 | ||
|
||
query I | ||
select sum_v1 from m8; | ||
---- | ||
4 | ||
1 | ||
|
||
statement ok | ||
create materialized view m9 as select * from t2; | ||
|
||
statement ok | ||
create materialized view m10 as select sum(v1) as sum_v1, sum(v3) as sum_v3 from m9 group by v2; | ||
|
||
statement ok | ||
flush; | ||
|
||
query III | ||
select v1, v2, v3 from m9; | ||
---- | ||
1 2 3 | ||
1 5 6 | ||
3 2 6 | ||
|
||
query II | ||
select sum_v1, sum_v3 from m10; | ||
---- | ||
4 9 | ||
1 6 | ||
|
||
statement ok | ||
create table t3(v1 int not null, v2 int not null, v3 int not null); | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
insert into t3 values (1,2,3),(1,5,6),(3,2,6); | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
create materialized view m11 as select v1, v2, v3 from t3; | ||
|
||
statement ok | ||
create materialized view m12 as select avg(v1) as avg_v1, sum(v2) as sum_v2, count(v3) as count_v3 from m11; | ||
|
||
statement ok | ||
flush; | ||
|
||
query III | ||
select v1, v2, v3 from m11; | ||
---- | ||
1 2 3 | ||
1 5 6 | ||
3 2 6 | ||
|
||
# TODO: enable avg_v1 | ||
query III | ||
select sum_v2, count_v3 from m12; | ||
---- | ||
9 3 | ||
|
||
statement ok | ||
create table t4(v1 real not null); | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
insert into t4 values(1),(2),(3); | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
create materialized view m13 as select * from t4; | ||
|
||
statement ok | ||
create materialized view m14 as select count(v1) as count_v1 from m13; | ||
|
||
statement ok | ||
flush; | ||
|
||
query I | ||
select v1 from m13; | ||
---- | ||
1 | ||
2 | ||
3 | ||
|
||
query I | ||
select * from m14; | ||
---- | ||
3 | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
drop materialized view m3; | ||
|
||
statement ok | ||
drop materialized view m4; | ||
|
||
statement ok | ||
drop materialized view m5; | ||
|
||
statement ok | ||
drop materialized view m1; | ||
|
||
statement ok | ||
drop materialized view m2; | ||
|
||
statement ok | ||
drop table t1; | ||
|
||
|
||
statement ok | ||
drop materialized view m7; | ||
|
||
statement ok | ||
drop materialized view m8; | ||
|
||
statement ok | ||
drop materialized view m6; | ||
|
||
statement ok | ||
drop materialized view m10; | ||
|
||
statement ok | ||
drop materialized view m9; | ||
|
||
statement ok | ||
drop table t2; | ||
|
||
|
||
statement ok | ||
drop materialized view m12; | ||
|
||
statement ok | ||
drop materialized view m11; | ||
|
||
statement ok | ||
drop table t3; | ||
|
||
|
||
statement ok | ||
drop materialized view m14; | ||
|
||
statement ok | ||
drop materialized view m13; | ||
|
||
statement ok | ||
drop table t4; |
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.