Skip to content

[BugFix] Fix missing partition predicate in short-circuit point lookup#71124

Merged
andyziye merged 2 commits into
StarRocks:mainfrom
wyb:short_circuit
Apr 1, 2026
Merged

[BugFix] Fix missing partition predicate in short-circuit point lookup#71124
andyziye merged 2 commits into
StarRocks:mainfrom
wyb:short_circuit

Conversation

@wyb

@wyb wyb commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Why I'm doing:

When enable_short_circuit=true, partition pruning may remove a partition
column predicate from conjuncts if the column is not a distribution column.
This caused computePointScanRangeLocations() to miss the predicate when
extracting primary key literals, resulting in an empty key list and an
empty query result.

What I'm doing:

merge prunedPartitionPredicates into conjuncts before calling extractPointsLiteral,
so all key column predicates are visible to the point lookup path.

Fixes #issue

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
    • This pr needs auto generate documentation
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.1
    • 4.0
    • 3.5
    • 3.4

@CelerData-Reviewer

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prunedPartitionPredicates back into the point-lookup predicate list before calling RowStoreUtils.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.

Comment thread test/sql/test_short_circuit/T/test_short_circuit
Comment thread fe/fe-core/src/main/java/com/starrocks/planner/OlapScanNode.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread fe/fe-core/src/main/java/com/starrocks/planner/OlapScanNode.java

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@wyb wyb enabled auto-merge (squash) April 1, 2026 07:27
@wyb

wyb commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

https://github.com/Mergifyio rebase main

wyb added 2 commits April 1, 2026 08:01
Signed-off-by: wyb <wybb86@gmail.com>
@mergify

mergify Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

rebase main

✅ Branch has been successfully rebased

@wyb wyb force-pushed the short_circuit branch from d1fd445 to 975417d Compare April 1, 2026 08:02
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

[FE Incremental Coverage Report]

fail : 3 / 6 (50.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/planner/OlapScanNode.java 3 6 50.00% [1658, 1659, 1661]

@sonarqubecloud

sonarqubecloud Bot commented Apr 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
D Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@andyziye andyziye disabled auto-merge April 1, 2026 11:47
@andyziye andyziye merged commit 87ac0b4 into StarRocks:main Apr 1, 2026
75 of 77 checks passed
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@Mergifyio backport branch-4.0

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@Mergifyio backport branch-4.1

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@Mergifyio backport branch-3.4

@github-actions github-actions Bot removed the 3.4 label Apr 1, 2026
@mergify

mergify Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

backport branch-3.5

✅ Backports have been created

Details

@mergify

mergify Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

backport branch-4.0

✅ Backports have been created

Details

@mergify

mergify Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

backport branch-4.1

✅ Backports have been created

Details

@mergify

mergify Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

backport branch-3.4

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Apr 1, 2026
#71124)

Signed-off-by: wyb <wybb86@gmail.com>
(cherry picked from commit 87ac0b4)
mergify Bot pushed a commit that referenced this pull request Apr 1, 2026
#71124)

Signed-off-by: wyb <wybb86@gmail.com>
(cherry picked from commit 87ac0b4)
mergify Bot pushed a commit that referenced this pull request Apr 1, 2026
#71124)

Signed-off-by: wyb <wybb86@gmail.com>
(cherry picked from commit 87ac0b4)
mergify Bot pushed a commit that referenced this pull request Apr 1, 2026
#71124)

Signed-off-by: wyb <wybb86@gmail.com>
(cherry picked from commit 87ac0b4)
wanpengfei-git pushed a commit that referenced this pull request Apr 1, 2026
…p (backport #71124) (#71160)

Signed-off-by: wyb <wybb86@gmail.com>
Co-authored-by: wyb <wybb86@gmail.com>
wanpengfei-git pushed a commit that referenced this pull request Apr 1, 2026
…p (backport #71124) (#71162)

Signed-off-by: wyb <wybb86@gmail.com>
Co-authored-by: wyb <wybb86@gmail.com>
wanpengfei-git pushed a commit that referenced this pull request Apr 1, 2026
…p (backport #71124) (#71163)

Signed-off-by: wyb <wybb86@gmail.com>
Co-authored-by: wyb <wybb86@gmail.com>
wanpengfei-git pushed a commit that referenced this pull request Apr 1, 2026
…p (backport #71124) (#71164)

Signed-off-by: wyb <wybb86@gmail.com>
Co-authored-by: wyb <wybb86@gmail.com>
DanRoscigno pushed a commit to chris-celerdata/starrocks that referenced this pull request Apr 6, 2026
wanpengfei-git pushed a commit that referenced this pull request May 5, 2026
…p (backport #71124) (backport #71160) (#72690)

Signed-off-by: wyb <wybb86@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: wyb <wybb86@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants