-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](mtmv) Fix rewrite fail by materialized view when filter or join condition has alias #44779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix](mtmv) Fix rewrite fail by materialized view when filter or join condition has alias #44779
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 39951 ms |
TPC-DS: Total hot run time: 198899 ms |
ClickBench: Total hot run time: 33.33 s |
|
run buildall |
TPC-H: Total hot run time: 40067 ms |
TPC-DS: Total hot run time: 197670 ms |
ClickBench: Total hot run time: 32.92 s |
… condition has alias
dffce5e to
511652a
Compare
|
run buildall |
TPC-H: Total hot run time: 40260 ms |
TPC-DS: Total hot run time: 190019 ms |
ClickBench: Total hot run time: 32.6 s |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
| // the key is the target join which should reject null, the value is a pair, the first value of the pair is the | ||
| // join type, the second value is also a pair which left represents the slots in the left of join that should | ||
| // reject null, right represents the slots in the right of join that should reject null. | ||
| // the key is the view join edge which should reject null, the value is a pair, the first value of the pair is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not use view in Hyper comments because it could used in other scene
… condition has alias (apache#44779) Related PR: apache#27922 Problem Summary: query and mv def are as following,` partsupp.public_col as public_col ` is alias, this would cause rewritting fail by materialized view with msg, the graph logic between query and view is different. select o_custkey, o_orderdate, o_shippriority, o_comment, o_orderkey, orders.public_col as col1, l_orderkey, l_partkey, l_suppkey, lineitem.public_col as col2, ps_partkey, ps_suppkey, partsupp.public_col as col3, partsupp.public_col * 2 as col4, o_orderkey + l_orderkey + ps_partkey * 2, sum( o_orderkey + l_orderkey + ps_partkey * 2 ), count() as count_all from ( select o_custkey, o_orderdate, o_shippriority, o_comment, o_orderkey, orders.public_col as public_col from orders ) orders left join ( select l_orderkey, l_partkey, l_suppkey, lineitem.public_col as public_col from lineitem where lineitem.public_col is null or lineitem.public_col <> 1 ) lineitem on l_orderkey = o_orderkey inner join ( select ps_partkey, ps_suppkey, partsupp.public_col as public_col from partsupp ) partsupp on ps_partkey = o_orderkey where lineitem.public_col is null or lineitem.public_col <> 1 and o_orderkey = 2 group by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14; Fix rewrite fail by materialized view when filter or join condition has alias
… condition has alias (apache#44779) ### What problem does this PR solve? Related PR: apache#27922 Problem Summary: query and mv def are as following,` partsupp.public_col as public_col ` is alias, this would cause rewritting fail by materialized view with msg, the graph logic between query and view is different. select o_custkey, o_orderdate, o_shippriority, o_comment, o_orderkey, orders.public_col as col1, l_orderkey, l_partkey, l_suppkey, lineitem.public_col as col2, ps_partkey, ps_suppkey, partsupp.public_col as col3, partsupp.public_col * 2 as col4, o_orderkey + l_orderkey + ps_partkey * 2, sum( o_orderkey + l_orderkey + ps_partkey * 2 ), count() as count_all from ( select o_custkey, o_orderdate, o_shippriority, o_comment, o_orderkey, orders.public_col as public_col from orders ) orders left join ( select l_orderkey, l_partkey, l_suppkey, lineitem.public_col as public_col from lineitem where lineitem.public_col is null or lineitem.public_col <> 1 ) lineitem on l_orderkey = o_orderkey inner join ( select ps_partkey, ps_suppkey, partsupp.public_col as public_col from partsupp ) partsupp on ps_partkey = o_orderkey where lineitem.public_col is null or lineitem.public_col <> 1 and o_orderkey = 2 group by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14; ### Release note Fix rewrite fail by materialized view when filter or join condition has alias
What problem does this PR solve?
query and mv def are as following,
partsupp.public_col as public_colis alias, this would cause rewritting fail by materialized view with msg, the graph logic between query and view is different.the pr fix this
Issue Number: close #xxx
Related PR: #27922
Problem Summary:
Rewrite fail by materialized view when filter or join condition has alias
Release note
Fix rewrite fail by materialized view when filter or join condition has alias
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)