fix: handle non-contiguous RowRanges when resolving global row IDs#383
Merged
Conversation
…ousBatchFirstRowId to GetGlobalRowId
lxy-9602
reviewed
Jun 27, 2026
zjw1111
reviewed
Jun 29, 2026
Co-authored-by: Zhang Jiawei <30893610+zjw1111@users.noreply.github.com>
zjw1111
reviewed
Jul 1, 2026
zjw1111
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the well-structured fix! The approach of replacing GetPreviousBatchFirstRowNumber() with per-row GetPreviousBatchFileRowId(batch_row_id) is a clean solution to the non-contiguous row problem under page-level predicate pushdown. The Parquet GenerateRowMapping logic correctly handles range gaps, and the test coverage (TestRowMapping*) is thorough.
A few items below for your consideration.
zjw1111
reviewed
Jul 1, 2026
zjw1111
reviewed
Jul 1, 2026
zjw1111
left a comment
Collaborator
There was a problem hiding this comment.
Two minor non-blocking nits — feel free to address in a follow-up commit.
lxy-9602
reviewed
Jul 1, 2026
lxy-9602
reviewed
Jul 1, 2026
zjw1111
approved these changes
Jul 2, 2026
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
previous_batch_start + offset.GetPreviousBatchFileRowId(batch_row_id)to resolve the file row ID for a row index inside the current batch.PrefetchFileBatchReaderImpl, cache the actual file row IDs for each returned batch and keep row-id mapping aligned when a batch is sliced byread_range.batch_row_id -> file_row_idmapping inNextBatch().GetPreviousBatchFileRowId()correct under non-contiguous rows caused by predicate + bitmap filtering._ROW_IDfield conversion, KeyValue iteration positions).Tests
src/paimon/format/avro/avro_file_batch_reader_test.cppsrc/paimon/format/blob/blob_file_batch_reader_test.cppsrc/paimon/format/lance/lance_format_reader_writer_test.cppsrc/paimon/format/orc/orc_file_batch_reader_test.cppsrc/paimon/format/parquet/parquet_file_batch_reader_test.cppsrc/paimon/common/reader/prefetch_file_batch_reader_impl_test.cppTestRowMappingto validate file row mapping across non-contiguous ranges.API and Format
FileBatchReaderand implementations now useGetPreviousBatchFileRowId(uint64_t batch_row_id).batch_row_idinside the current batch (instead of deriving by batch start + offset under contiguous assumptions).Documentation
No.
Generative AI tooling
gpt-5.3-codex