Skip to content

Conversation

@stephen-shelby
Copy link
Contributor

@stephen-shelby stephen-shelby commented Jan 15, 2026

Why I'm doing:

With cbo_json_v2_rewrite enabled, applying TF_JSON_PATH_REWRITE can prune away partition columns when partition pruning moves partition predicates from scan.predicate into prunedPartitionPredicates. This may cause plan validation to fail with Input dependency cols check failed (issue #67665).

What I'm doing:

  • Include columns referenced by prunedPartitionPredicates in the scan’s requiredColumnSet during JsonPathRewriteRule so partition columns are not dropped from colRefToColumnMetaMap.

Fixes #67665

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

Signed-off-by: stephen <stephen5217@163.com>
@stephen-shelby stephen-shelby requested a review from a team as a code owner January 15, 2026 11:06
@StarRocks-Reviewer
Copy link

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!

@stephen-shelby stephen-shelby changed the title [BugFix] Fix JSON path rewrite pruning partition predicate columns [UT] Fix JSON path rewrite pruning partition predicate columns Jan 15, 2026
@stephen-shelby stephen-shelby changed the title [UT] Fix JSON path rewrite pruning partition predicate columns [BugFix] Fix JSON path rewrite pruning partition predicate columns Jan 15, 2026
@sonarqubecloud
Copy link

@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 6 / 6 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/sql/optimizer/rule/tree/JsonPathRewriteRule.java 6 6 100.00% []

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

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.

[Bug] Invalid query plan caused by prunedPartitionPredicates containing required column

3 participants