[BugFix] Fix missing partition predicate in short-circuit point lookup#71124
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Fixes a correctness bug in the short-circuit point lookup path where partition pruning could remove required partition-column predicates from conjuncts, preventing primary-key literal extraction and producing empty results when enable_short_circuit=true.
Changes:
- Merge
prunedPartitionPredicatesback into the point-lookup predicate list before callingRowStoreUtils.extractPointsLiteral(...). - Add a SQL regression test covering a partition column that is not part of the distribution columns under short-circuit point lookup.
- Update expected test outputs for the new test case.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
fe/fe-core/src/main/java/com/starrocks/planner/OlapScanNode.java |
Merges pruned partition predicates into conjuncts prior to PK literal extraction for point lookup. |
test/sql/test_short_circuit/T/test_short_circuit |
Adds a regression test for partitioned primary-key point lookup with short-circuit enabled. |
test/sql/test_short_circuit/R/test_short_circuit |
Adds the golden results for the new regression test. |
|
https://github.com/Mergifyio rebase main |
Signed-off-by: wyb <wybb86@gmail.com>
Signed-off-by: wyb <wybb86@gmail.com>
✅ Branch has been successfully rebased |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]❌ fail : 3 / 6 (50.00%) file detail
|
|
|
@Mergifyio backport branch-4.0 |
|
@Mergifyio backport branch-4.1 |
|
@Mergifyio backport branch-3.4 |
✅ Backports have been createdDetails
|
✅ Backports have been createdDetails
|
✅ Backports have been createdDetails
|
✅ Backports have been createdDetails
|
StarRocks#71124) Signed-off-by: wyb <wybb86@gmail.com>




Why I'm doing:
When
enable_short_circuit=true, partition pruning may remove a partitioncolumn predicate from conjuncts if the column is not a distribution column.
This caused
computePointScanRangeLocations()to miss the predicate whenextracting primary key literals, resulting in an empty key list and an
empty query result.
What I'm doing:
merge
prunedPartitionPredicatesintoconjunctsbefore callingextractPointsLiteral,so all key column predicates are visible to the point lookup path.
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: