Repository navigation
feat(parquet): add row number reader for selected row groups - #1006
Open
advancedxy wants to merge 2 commits into
Open
advancedxy wants to merge 2 commits into
advancedxy wants to merge 2 commits into
Conversation
advancedxy
commented
Oct 13, 2026
Comment on lines
+167
to
+172
| // Metadata columns belong to top-level rows; nested fields need no positions. | ||
| ICEBERG_ASSIGN_OR_RAISE( | ||
| projected_array, | ||
| ProjectNestedArray(parquet_array, output_arrow_type, nested_type, | ||
| field_projection.children, metadata_context, pool)); | ||
| field_projection.children, metadata_context, | ||
| /*row_positions=*/nullptr, pool)); |
Contributor
Author
There was a problem hiding this comment.
not satisfied about these nullptr changes yet, however I don't find a more elegant way to passing row positions as it will touch all the ProjectedXXXMethods.
happy to take suggestions.
This branch has not been deployed
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.
What
Add a
RowNumberReader, modeled after parquet-rs, that emits absolute file row positions from the selected Parquet row groups.Use the resulting position array for
_posand inherited_row_idin record-batch projection. Preserve physical lineage values and cross-row-group batching. Restore consumed ranges if array construction fails so the batch can be retried.Why
Follow-up to the row-position tracking discussion in #956.
Updating
next_file_posby the emitted batch size assumes contiguous file rows. Row-group pruning can introduce gaps, so each selected row must retain its original position in the file.Testing
parquet_test,arrow_test, andavro_testpassed.git diff --checkpassed.Limitations and follow-up
The Iceberg-side
RowNumberReadercan account for row-group-level skipping only: it knows the selected row groups and their row counts. It cannot account for page-level skipping inside Arrow C++ because the skipped row ranges are not exposed alongside the output batches; batch lengths alone are insufficient to recover the original positions.Supporting page-level skipping requires integrating row-number generation into Arrow C++'s Parquet reader, where it can stay synchronized with page skipping and the actual rows emitted. This is the planned follow-up. Iceberg C++ can then consume that position array for
_posand inherited_row_id, replacing its localRowNumberReader. Keeping position generation separate from Iceberg metadata semantics prepares for that integration.