Uh oh!
There was an error while loading. Please reload this page.
[fix](mtmv) Fix union all rewrite wrongly when mv refresh which grace_period is big - #50812
Conversation
Thearas
commented
May 12, 2025
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
seawinde
commented
May 12, 2025
run buildall |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with union all rewriting during materialized view refresh when the grace_period is large. Key changes include updating test outputs for union rewriting, improving logging to use sqlHash instead of queryId, caching valid MV partitions in the StatementContext, and adding a check on the materialized view property use_for_rewrite in the MV relation manager.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| regression-test/data/nereids_rules_p0/mv/union_rewrite_grace_big/unioin_rewrite_grace_big.out | Added expected output for union rewriting tests. |
| fe/fe-core/src/test/java/org/apache/doris/nereids/mv/OptimizeGetAvailableMvsTest.java | Added tests for both partition prune and non-partition prune scenarios. |
| fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/InitMaterializationContextHook.java | Updated log messages to use sqlHash instead of queryId. |
| fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/AbstractMaterializedViewRule.java | Changed MV partition retrieval to use the cached map from StatementContext. |
| fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java | Added a new map to cache MV available rewrite partitions. |
| fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelationManager.java | Added a check for the use_for_rewrite property and updated partition validation accordingly. |
Comments suppressed due to low confidence (1)
regression-test/data/nereids_rules_p0/mv/union_rewrite_grace_big/unioin_rewrite_grace_big.out:1
- The filename 'unioin_rewrite_grace_big.out' appears to be misspelled; consider renaming it to 'union_rewrite_grace_big.out' for clarity.
+-- This file is automatically generated. You should know what you did if you want to edit this
doris-robot
commented
May 12, 2025
TPC-H: Total hot run time: 34182 ms |
doris-robot
commented
May 12, 2025
TPC-DS: Total hot run time: 187050 ms |
doris-robot
commented
May 12, 2025
ClickBench: Total hot run time: 29.02 s |
What problem does this PR solve?
there is mv def is
aflter mv_1_name refreshed, we insert into data to
lineitemif another mv_2_name which def is the same with the mv_1_name
when we refresh mv_2_name should contain the new inserted data, but now not, the pr fix this
Issue Number: close #xxx
Related PR: #38115
Problem Summary:
Release note
Fix union all rewrite wrongly when mv refresh which grace_period is big
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)