Skip to content

feat(table): support partition predicate pruning in TableScan#167

Merged
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:feat/partition-predicate
Apr 1, 2026
Merged

feat(table): support partition predicate pruning in TableScan#167
JingsongLi merged 1 commit into
apache:mainfrom
QuakeWang:feat/partition-predicate

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

Purpose

Linked issue: close #155

Add ReadBuilder::with_filter(Predicate) and wire partition predicate evaluation into TableScan::plan_snapshot to prune manifest entries by partition values, using the split-then-evaluate approach aligned with Java Paimon's splitPartitionPredicatesAndDataPredicates.

Brief change log

  • Add Predicate enum, Datum, PredicateOperator, and PredicateBuilder with name-based field resolution and type validation
  • Add ReadBuilder::with_filter(Predicate) to accept user filters
  • Wire partition predicate evaluation into TableScan::plan_snapshot using split-then-evaluate: split at AND boundaries, remap partition-only conjuncts, evaluate against partition BinaryRow, with result caching
  • Error handling: BinaryRow decode failure → fail-open; eval_row error → fail-fast

Tests

API and Format

New public API additions:

  • Datum, PredicateOperator, Predicate, PredicateBuilder — public types in paimon::spec
  • field_idx_to_partition_idx() — public utility function
  • ReadBuilder::with_filter(Predicate) — new builder method

Documentation

@JingsongLi

Copy link
Copy Markdown
Contributor

Please resolve conflicts.

@QuakeWang QuakeWang force-pushed the feat/partition-predicate branch from 1a66a01 to b88c8a5 Compare April 1, 2026 13:43
@QuakeWang

Copy link
Copy Markdown
Member Author

Please resolve conflicts.

@JingsongLi I have resolved the conflicts, and PTAL

@JingsongLi JingsongLi 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.

+1

@JingsongLi JingsongLi merged commit 0cb1a83 into apache:main Apr 1, 2026
8 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.

feat: Partition predicate evaluation in TableScan

2 participants