[fix](partition pruning) Preserve partition pruning state in plan copies - #67113
Open
feiniaofeiafei wants to merge 1 commit into
Open
[fix](partition pruning) Preserve partition pruning state in plan copies#67113feiniaofeiafei wants to merge 1 commit into
feiniaofeiafei wants to merge 1 commit into
Conversation
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: LogicalOlapScan.withRelationId reset partitionPruned and hasPartitionPredicate as a hidden side effect, which broke default deep-copy semantics. Preserve both fields while replacing the relation ID. Add an explicit DeepCopierContext option that StructInfo enables for MTMV union compensation, so copied OLAP scans invalidate only partitionPruned during the existing copy traversal and the following whole-tree rewrite reapplies partition pruning.
### Release note
None
### Check List (For Author)
- Test: Unit Test
- ./run-fe-ut.sh --run org.apache.doris.nereids.trees.copier.LogicalPlanDeepCopierTest,org.apache.doris.nereids.mv.StructInfoTest
- mvn checkstyle:check -pl fe-core
- Behavior changed: Yes. Default plan copies preserve partition pruning metadata, while MTMV union compensation explicitly invalidates partitionPruned during its copy.
- Does this need documentation: No
feiniaofeiafei
requested review from
924060929,
englefly,
morrySnow and
starocean999
as code owners
August 25, 2026 06:40
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Collaborator
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 17094 ms |
Contributor
TPC-DS: Total hot run time: 82007 ms |
Contributor
ClickBench: Total hot run time: 14.82 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
starocean999
approved these changes
Aug 26, 2026
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?
Issue Number: #62196
Related PR:
Problem Summary: LogicalOlapScan.withRelationId reset partitionPruned and hasPartitionPredicate as a hidden side effect, which broke default deep-copy semantics. Preserve both fields while replacing the relation ID. Add an explicit DeepCopierContext option that StructInfo enables for MTMV union compensation, so copied OLAP scans invalidate only partitionPruned during the existing copy traversal and the following whole-tree rewrite reapplies partition pruning.
Release note
None
Check List (For Author)
What problem does this PR solve?
Issue 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)