Skip to content

[fix](nereids) Keep partition predicates for short-circuit point queries - #66926

Draft
bzhang-obsec wants to merge 1 commit into
apache:masterfrom
bzhang-obsec:fix/point-query-list-partition
Draft

[fix](nereids) Keep partition predicates for short-circuit point queries#66926
bzhang-obsec wants to merge 1 commit into
apache:masterfrom
bzhang-obsec:fix/point-query-list-partition

Conversation

@bzhang-obsec

@bzhang-obsec bzhang-obsec commented Aug 19, 2026

Copy link
Copy Markdown

Partition pruning removes a partition predicate once the surviving partitions fully imply it, e.g. pk = 'abcd' against a LIST partition whose only value is 'abcd'. A short-circuit point query needs the equality conjuncts on every key column to remain in the scan: they are what PointQueryExecutor uses to pick the bucket and build the key tuple. Without them the executor fails with IllegalStateException.

Extend the existing skipPrunePredicate carve-outs (session variable, delete statements) with short-circuit queries, in both the rewrite rule and the post processor.

What problem does this PR solve?

Issue Number: close #66030.

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

Partition pruning removes a partition predicate once the surviving
partitions fully imply it, e.g. `pk = 'abcd'` against a LIST partition
whose only value is 'abcd'. A short-circuit point query needs the
equality conjuncts on every key column to remain in the scan: they are
what PointQueryExecutor uses to pick the bucket and build the key tuple.
Without them the executor fails with IllegalStateException.

Extend the existing skipPrunePredicate carve-outs (session variable,
delete statements) with short-circuit queries, in both the rewrite rule
and the post processor.

Fixes apache#66030.
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@bzhang-obsec

Copy link
Copy Markdown
Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 0.00% (0/4) 🎉
Increment coverage report
Complete coverage report

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.

[Bug] IllegalStateException Exception when running short-circuit query on table with PARTITION BY LIST

2 participants