Uh oh!
There was an error while loading. Please reload this page.
[fix](mtmv) Fix nested mv rewritten fail when bottom mv is partitioned - #57558
Conversation
hello-stephen
commented
Oct 31, 2025
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
seawinde
commented
Oct 31, 2025
run buildall |
doris-robot
commented
Oct 31, 2025
ClickBench: Total hot run time: 29.03 s |
| Map<List<String>, Set<String>> queryUsedRelatedTablePartitionsMap = new HashMap<>(); | ||
| tableLoop: | ||
| for (Map.Entry<List<String>, TableIf> queryUsedTableEntry : statementContext.getTables().entrySet()) { | ||
| for (List<String> queryUsedTable : tableUsedPartitionNameMap.keySet()) { |
There was a problem hiding this comment.
beacuse some table would not in tables in statement context, such as bottom mv which is not query directly in query, so not need to use tables in statement context,
| } | ||
| usedPartitionSet.addAll(partitionPair.value()); | ||
| tableUsedPartitionNameMap.get(queryUsedTable); | ||
| if (ALL_PARTITIONS_LIST.equals(tableUsedPartitions)) { |
There was a problem hiding this comment.
Add some comments to explain what ALL-PARTITION-LIST is and what ALL-PARTITION-LIST. equals (tableUsedPieces) means
| } | ||
| for (Pair<RelationId, Set<String>> tableUsedPartitionPair : tableUsedPartitions) { | ||
| if (!customRelationIdSet.isEmpty()) { | ||
| if (ALL_PARTITIONS.equals(tableUsedPartitionPair)) { |
| mv_rewrite_any_success(sql_5, [mv_3, mv_4, mv_5]) | ||
| compare_res(sql_5 + " order by 1,2,3,4,5,6,7,8,9,10,11,12,13") | ||
| sql """ |
There was a problem hiding this comment.
Add some case validation to supplement union situations, such as inserting a row of data into a partition of the base table
There was a problem hiding this comment.
union situations not support query rewrite by materialized view currently, so not need to add
hello-stephen
commented
Oct 31, 2025
FE Regression Coverage ReportIncrement line coverage |
seawinde
commented
Nov 3, 2025
run buildall |
| /** | ||
| * | ||
| * */ |
doris-robot
commented
Nov 3, 2025
TPC-DS: Total hot run time: 190359 ms |
doris-robot
commented
Nov 3, 2025
ClickBench: Total hot run time: 27.83 s |
seawinde
commented
Nov 3, 2025
run buildall |
doris-robot
commented
Nov 3, 2025
ClickBench: Total hot run time: 29.34 s |
hello-stephen
commented
Nov 4, 2025
FE Regression Coverage ReportIncrement line coverage |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
apache#57558) Related PR: apache#49514apache#56958 Problem Summary: In the scenario of nested materialized view rewriting, if the underlying materialized view is a partitioned materialized view, the rewriting of the upper-level materialized view would fail. This PR fixes the issue.
apache#57558) Related PR: apache#49514apache#56958 Problem Summary: In the scenario of nested materialized view rewriting, if the underlying materialized view is a partitioned materialized view, the rewriting of the upper-level materialized view would fail. This PR fixes the issue.
apache#57558) Related PR: apache#49514apache#56958 Problem Summary: In the scenario of nested materialized view rewriting, if the underlying materialized view is a partitioned materialized view, the rewriting of the upper-level materialized view would fail. This PR fixes the issue.
… partitioned (#57558) (#58277) pr: #57558 commitId: 5e43141 ### What problem does this PR solve? 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 -->
…te fail because of invalid slot (#58643) ### What problem does this PR solve? Related PR: #57558#58413 Problem Summary: This fix addresses the following three issues: 1. When invoking the method org.apache.doris.nereids.trees.plans.logical.LogicalHudiScan#withRelationId, the output needs to be recalculated to meet expectations. 2. After compensating with a union all due to partial partition invalidation of a materialized view, during the next round of transparent rewriting, the rewriting for the child of the union allshould use the query partitioncorresponding to the specific relation id to prevent infinite loops. 3. Currently, in the `test_hudi_rewrite_mtmv` test, if the plan rewritten by the materialized view transparent rewriting is not selected by the CBO, it is difficult to troubleshoot because explain memo planis not used. Therefore, the corresponding test method is modified.
…te fail because of invalid slot (apache#58643) Related PR: apache#57558apache#58413 Problem Summary: This fix addresses the following three issues: 1. When invoking the method org.apache.doris.nereids.trees.plans.logical.LogicalHudiScan#withRelationId, the output needs to be recalculated to meet expectations. 2. After compensating with a union all due to partial partition invalidation of a materialized view, during the next round of transparent rewriting, the rewriting for the child of the union allshould use the query partitioncorresponding to the specific relation id to prevent infinite loops. 3. Currently, in the `test_hudi_rewrite_mtmv` test, if the plan rewritten by the materialized view transparent rewriting is not selected by the CBO, it is difficult to troubleshoot because explain memo planis not used. Therefore, the corresponding test method is modified.
…te fail because of invalid slot (apache#58643) Related PR: apache#57558apache#58413 Problem Summary: This fix addresses the following three issues: 1. When invoking the method org.apache.doris.nereids.trees.plans.logical.LogicalHudiScan#withRelationId, the output needs to be recalculated to meet expectations. 2. After compensating with a union all due to partial partition invalidation of a materialized view, during the next round of transparent rewriting, the rewriting for the child of the union allshould use the query partitioncorresponding to the specific relation id to prevent infinite loops. 3. Currently, in the `test_hudi_rewrite_mtmv` test, if the plan rewritten by the materialized view transparent rewriting is not selected by the CBO, it is difficult to troubleshoot because explain memo planis not used. Therefore, the corresponding test method is modified.
…te fail because of invalid slot (apache#58643) ### What problem does this PR solve? Related PR: apache#57558apache#58413 Problem Summary: This fix addresses the following three issues: 1. When invoking the method org.apache.doris.nereids.trees.plans.logical.LogicalHudiScan#withRelationId, the output needs to be recalculated to meet expectations. 2. After compensating with a union all due to partial partition invalidation of a materialized view, during the next round of transparent rewriting, the rewriting for the child of the union allshould use the query partitioncorresponding to the specific relation id to prevent infinite loops. 3. Currently, in the `test_hudi_rewrite_mtmv` test, if the plan rewritten by the materialized view transparent rewriting is not selected by the CBO, it is difficult to troubleshoot because explain memo planis not used. Therefore, the corresponding test method is modified.
What problem does this PR solve?
In the scenario of nested materialized view rewriting, if the underlying materialized view is a partitioned materialized view, the rewriting of the upper-level materialized view would fail. This PR fixes the issue.
Issue Number: close #xxx
Related PR: #49514#56958
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)