fix(table): keep _ROW_ID predicates out of partition-key projection - #642
Draft
plusplusjiajia wants to merge 1 commit into
Draft
fix(table): keep _ROW_ID predicates out of partition-key projection#642plusplusjiajia wants to merge 1 commit into
plusplusjiajia wants to merge 1 commit into
Conversation
plusplusjiajia
force-pushed
the
fix-row-id-partition-projection
branch
4 times, most recently
from
July 31, 2026 17:00
cb1cb5e to
b168926
Compare
plusplusjiajia
force-pushed
the
fix-row-id-partition-projection
branch
from
July 31, 2026 17:20
b168926 to
df6854e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
_ROW_ID is not a table column, so PredicateBuilder cannot resolve it and callers hand-build the leaf with an index of their own — 0, as the existing test_with_filter_extracts_row_id_ranges does.
split_scan_predicates maps conjuncts onto partition keys by index, so on a table whose first field is a partition key, WHERE _ROW_ID >= 10 became a predicate on that key and pruned partitions by comparing them
against row ids, silently dropping rows. bucket_predicate maps by index too.
Java strips row-id conjuncts by name in DataEvolutionBatchScan.rowIdSafeResidualFilter; pypaimon's __try_parse_partition_predicate rejects a field not in partition_keys before it looks at an index. Rust was the
only implementation mapping by index with no name-level guard.
Brief change log
The guard lives in split_scan_predicates itself — the shared function that does the index mapping — so both the Paimon and Format read builders are covered, and normalize_filter strips before computing
bucket_predicate:
and the NOT has to stay.