[fix](mtmv) Fix rewrite fail by materialized view when filter or join condition has alias#44779
Merged
morrySnow merged 2 commits intoapache:masterfrom Dec 5, 2024
Merged
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
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 |
Member
Author
|
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
Member
Author
|
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 |
starocean999
approved these changes
Dec 5, 2024
starocean999
approved these changes
Dec 5, 2024
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
morrySnow
approved these changes
Dec 5, 2024
| // 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 |
Contributor
There was a problem hiding this comment.
should not use view in Hyper comments because it could used in other scene
seawinde
added a commit
to seawinde/doris
that referenced
this pull request
Dec 6, 2024
… 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
16 tasks
seawinde
added a commit
to seawinde/doris
that referenced
this pull request
Dec 6, 2024
… 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
16 tasks
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)