-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](mtmv) Fix rewrite fail when join conjuncts eliminate and group by key eliminate both happened #55674
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 when join conjuncts eliminate and group by key eliminate both happened #55674
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 34183 ms |
TPC-DS: Total hot run time: 187125 ms |
ClickBench: Total hot run time: 33.01 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
8515b54 to
3e3ecdf
Compare
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
1f86cde to
ef11d48
Compare
|
run buildall |
1 similar comment
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
2b97636 to
b49e6f4
Compare
|
run buildall |
TPC-H: Total hot run time: 1475 ms |
TPC-DS: Total hot run time: 2757 ms |
ClickBench: Total hot run time: 0.08 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
|
run buildall |
1 similar comment
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
1 similar comment
FE UT Coverage ReportIncrement line coverage |
4c85ba7 to
650e487
Compare
|
run buildall |
ClickBench: Total hot run time: 28.07 s |
FE UT Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…by key eliminate both happened (apache#55674) if mv def is as fllowing: CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO PROPERTIES ( "replication_num" = "1" ) as select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(a.created_date, '%Y%m') month, a.created_date from data_event a join customer b on(a.cust_id=b.cust_id) group by a.cust_id, a.event_type_id, a.bind_attr, month, a.created_date; if query is as fllowing, the query pattern, the query can be optimized by rule `ELIMINATE_CONST_JOIN_CONDITION` and `ELIMINATE_GROUP_BY_KEY_BY_UNIFORM` this would cause rewrite fail by mv, the pr fix this select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(created_date, '%Y%m') month from data_event a inner join customer b on (a.cust_id = b.cust_id) where a.cust_id = 410723002257 and date_format(a.created_date, '%Y%m') = '202509' group by a.cust_id, a.event_type_id, a.bind_attr, month;
…by key eliminate both happened (apache#55674) if mv def is as fllowing: CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO PROPERTIES ( "replication_num" = "1" ) as select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(a.created_date, '%Y%m') month, a.created_date from data_event a join customer b on(a.cust_id=b.cust_id) group by a.cust_id, a.event_type_id, a.bind_attr, month, a.created_date; if query is as fllowing, the query pattern, the query can be optimized by rule `ELIMINATE_CONST_JOIN_CONDITION` and `ELIMINATE_GROUP_BY_KEY_BY_UNIFORM` this would cause rewrite fail by mv, the pr fix this select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(created_date, '%Y%m') month from data_event a inner join customer b on (a.cust_id = b.cust_id) where a.cust_id = 410723002257 and date_format(a.created_date, '%Y%m') = '202509' group by a.cust_id, a.event_type_id, a.bind_attr, month;
…by key eliminate both happened (apache#55674) if mv def is as fllowing: CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO PROPERTIES ( "replication_num" = "1" ) as select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(a.created_date, '%Y%m') month, a.created_date from data_event a join customer b on(a.cust_id=b.cust_id) group by a.cust_id, a.event_type_id, a.bind_attr, month, a.created_date; if query is as fllowing, the query pattern, the query can be optimized by rule `ELIMINATE_CONST_JOIN_CONDITION` and `ELIMINATE_GROUP_BY_KEY_BY_UNIFORM` this would cause rewrite fail by mv, the pr fix this select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(created_date, '%Y%m') month from data_event a inner join customer b on (a.cust_id = b.cust_id) where a.cust_id = 410723002257 and date_format(a.created_date, '%Y%m') = '202509' group by a.cust_id, a.event_type_id, a.bind_attr, month;
…by key eliminate both happened (#55674) (#57923) ### What problem does this PR solve? pr: #55674 commitId: c185cde Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
…by key eliminate both happened (apache#55674) if mv def is as fllowing: CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO PROPERTIES ( "replication_num" = "1" ) as select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(a.created_date, '%Y%m') month, a.created_date from data_event a join customer b on(a.cust_id=b.cust_id) group by a.cust_id, a.event_type_id, a.bind_attr, month, a.created_date; if query is as fllowing, the query pattern, the query can be optimized by rule `ELIMINATE_CONST_JOIN_CONDITION` and `ELIMINATE_GROUP_BY_KEY_BY_UNIFORM` this would cause rewrite fail by mv, the pr fix this select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(created_date, '%Y%m') month from data_event a inner join customer b on (a.cust_id = b.cust_id) where a.cust_id = 410723002257 and date_format(a.created_date, '%Y%m') = '202509' group by a.cust_id, a.event_type_id, a.bind_attr, month;
This PR aims to fix several failing regression tests related to Materialized Views (MTMV), ensuring the stability and correctness of the MTMV feature. The specific failing test cases addressed are: nereids_rules_p0.mv.pre_rewrite.limit.query_with_limit nested_materialized_view mv_tpch_test Related PR: #55066 #55674
This PR aims to fix several failing regression tests related to Materialized Views (MTMV), ensuring the stability and correctness of the MTMV feature. The specific failing test cases addressed are: nereids_rules_p0.mv.pre_rewrite.limit.query_with_limit nested_materialized_view mv_tpch_test Related PR: #55066 #55674
This PR aims to fix several failing regression tests related to Materialized Views (MTMV), ensuring the stability and correctness of the MTMV feature. The specific failing test cases addressed are: nereids_rules_p0.mv.pre_rewrite.limit.query_with_limit nested_materialized_view mv_tpch_test Related PR: apache#55066 apache#55674
What problem does this PR solve?
if mv def is as fllowing:
CREATE MATERIALIZED VIEW mv1 BUILD IMMEDIATE REFRESH AUTO PROPERTIES ( "replication_num" = "1" ) as select a.cust_id, a.event_type_id, a.bind_attr, sum(sum_amount) sum_amount, date_format(a.created_date, '%Y%m') month, a.created_date from data_event a join customer b on(a.cust_id=b.cust_id) group by a.cust_id, a.event_type_id, a.bind_attr, month, a.created_date;if query is as fllowing, the query pattern, the query can be optimized by rule
ELIMINATE_CONST_JOIN_CONDITIONandELIMINATE_GROUP_BY_KEY_BY_UNIFORMthis would cause rewrite fail by mv, the pr fix thisIssue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)