forked from risingwavelabs/risingwave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(optimizer): logical scan pk derive (risingwavelabs#1340)
* fix LogicalScan::logical_rewrite_for_stream * add ut * fix test Signed-off-by: Alex Chi <iskyzh@gmail.com> Co-authored-by: Alex Chi <iskyzh@gmail.com>
- Loading branch information
Showing
3 changed files
with
35 additions
and
3 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
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,19 @@ | ||
- id: create_tables | ||
sql: | | ||
create table t1(v1 int not null, v2 int not null); | ||
create table t2(v1 real not null, v2 int not null, v3 real not null); | ||
create materialized view m1 as select v1, v2 from t1 where v1 = 1; | ||
create materialized view m2 as select v1, v2 from t1 where v2 = 1; | ||
- id: mv_on_mv_join | ||
before: | ||
- create_tables | ||
sql: | | ||
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; | ||
stream_plan: | | ||
StreamMaterialize { columns: [m1v1, m1v2, m2v1, m2v2, expr#4(hidden), expr#5(hidden)], pk_columns: [expr#4, expr#5] } | ||
StreamProject { exprs: [$0, $1, $3, $4, $2, $5], expr_alias: [m1v1, m1v2, m2v1, m2v2, , ] } | ||
StreamHashJoin { type: Inner, predicate: $0 = $3 } | ||
StreamExchange { dist: HashShard([0]) } | ||
StreamTableScan { table: m1, columns: [v1, v2, _row_id], pk_indices: [2] } | ||
StreamExchange { dist: HashShard([0]) } | ||
StreamTableScan { table: m2, columns: [v1, v2, _row_id], pk_indices: [2] } |