Skip to content

branch-4.0:[fix](partition_prune) Move the pruning of predicates that are alwaystrue after partition pruning into the PlanPostProcessor #63111#63467

Merged
yiguolei merged 1 commit into
apache:branch-4.0from
feiniaofeiafei:pick_prune_predicate_mv_4.0
May 22, 2026
Merged

Conversation

@feiniaofeiafei
Copy link
Copy Markdown
Contributor

picked from #63111

… true after partition pruning into the PlanPostProcessor (apache#63111)

Related PR: apache#57169

Problem Summary:
After partition pruning, predicates that are evaluated to constant true
are removed as an optimization (introduced by apache#57169). However, this
introduced a bug in materialized view rewriting: when such predicates
are removed, they are not compensated above the rewritten materialized
view. Since the materialized view itself is not partitioned, this leads
to incorrect query results.

This PR fixes the issue by moving the removal of constant-true
predicates to the planPostProcessors phase. This ensures that the
predicate removal does not interfere with materialized view rewriting,
preserving correctness while still retaining the optimization benefit.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@feiniaofeiafei
Copy link
Copy Markdown
Contributor Author

run buildall

@feiniaofeiafei
Copy link
Copy Markdown
Contributor Author

run p0

@feiniaofeiafei
Copy link
Copy Markdown
Contributor Author

run feut

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 55.41% (82/148) 🎉
Increment coverage report
Complete coverage report

@yiguolei yiguolei merged commit 9577291 into apache:branch-4.0 May 22, 2026
31 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants