Position delete read improvements#2532
Open
romusz wants to merge 3 commits into
Open
Conversation
Position delete files may set `referenced_data_file` to scope their deletes to a single data file. Per the Iceberg spec such a delete applies only when its `referenced_data_file` equals the data file's path exactly; a null value retains the prior partition-scoped behavior. PopulatedDeleteFileIndex::get_deletes_for_data_file now enforces this, replacing the long-standing TODO that applied every partition-scoped position delete to all data files in the partition.
The caching delete-file loader assumed positional column order (file_path at index 0, pos at index 1) when parsing position delete files. Resolve the file_path and pos columns by their reserved Iceberg field IDs instead, via metadata_columns::resolve_position_delete_columns, so reordered or additional columns parse correctly. Also reject non-Parquet delete files with a FeatureUnsupported error and reject negative positions as invalid data. FileScanTaskDeleteFile now carries the delete file's format and referenced_data_file from the manifest entry. Includes test-fixture updates for the two new FileScanTaskDeleteFile fields.
Scan column resolution used is_metadata_column_name, which also matches the persisted delete-file schema fields file_path and pos. A user table column literally named pos or file_path was therefore resolved to a reserved metadata field ID instead of its real schema field ID, corrupting the projection. Introduce is_scan_metadata_column_name, which matches only the virtual (underscore-prefixed) scan columns, and use it in scan planning. Deprecate rather than remove is_metadata_column_name, since it is published API as of 0.8.0. Includes a scan test asserting a column named "pos" resolves to its table-schema field ID.
romusz
commented
May 30, 2026
| /// # Returns | ||
| /// `true` if the column name is a metadata column, `false` otherwise | ||
| #[deprecated( | ||
| since = "0.10.0", |
Author
There was a problem hiding this comment.
this version needs to be agreed on
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.
Which issue does this PR close?
pre-work for #340, writer implementation to follow
What changes are included in this PR?
Are these changes tested?