feat(scan): [3/N] read and apply V3 deletion vectors - #3035
Open
mbutrovich wants to merge 18 commits into
Open
Conversation
Add referenced_data_file, content_offset, and content_size_in_bytes to FileScanTaskDeleteFile, populated from the delete file's manifest entry. These locate a deletion-vector blob and scope it to its data file, which the delete loader needs to read and apply V3 deletion vectors. Refs apache#2792.
# Conflicts: # crates/iceberg/src/delete_file_index.rs
3 tasks
# Conflicts: # crates/iceberg/src/delete_file_index.rs # crates/iceberg/src/scan/task.rs
mbutrovich
marked this pull request as ready for review
August 27, 2026 15:01
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?
deletion-vector-v1Puffin blobs) #2792.What changes are included in this PR?
Task 3 of the deletion-vector read epic: reading and applying V3 deletion vectors during a scan. Follows #2868, now merged, so this is based on
main.CachingDeleteFileLoaderreads a deletion vector'sdeletion-vector-v1blob directly from its Puffin file by byte range (content_offset/content_size_in_bytes), decrypting first viaEncryptedInputFilewhen the entry carries key metadata.record_count, matching the check Iceberg-Java does inBitmapPositionDeleteIndex.deserializeBitmap. A mismatch is aDataInvaliderror, not a silent wrong result.DeleteFileIndexindexes deletion vectors byreferenced_data_fileand applies them ahead of position delete files, since a DV supersedes any position deletes for the same data file per spec.FileScanTaskDeleteFilegains afile_formatfield, populated from the manifest entry. Both the index and the loader now identify a deletion vector as aPositionDeletesentry stored asPuffin, rather than by the presence ofcontent_offset, per @CTTY's review feedback on feat(scan): [2/N] carry deletion-vector coordinates on FileScanTaskDeleteFile #2868.referenced_data_file,content_offset,content_size_in_bytes, orrecord_count, all of which the spec requiresDeleteVector::deserialize(from feat(delete-vector): [1/N] decode deletion-vector-v1 puffin blobs #2866) is wired in, and its#[allow(dead_code)]removed.The data file read path is unchanged outside of deletion vectors, as is existing position delete and equality delete handling.
Are these changes tested?
Yes.
delete_file_index.rs: DV supersedes partition-scoped and path-scoped position deletes, DV coexists with equality deletes, and rejection of a DV that is missingreferenced_data_fileor its Puffin coordinates, duplicated for one data file, or carrying a mismatched partition or stale sequence number.caching_delete_file_loader.rs: reading and applying a DV, reading an encrypted DV, rejecting a cardinality mismatch, and the coordinate and cardinality validation helpers against each missing or negative field.positional_deletes.rsreading a Parquet data file with a DV applied throughArrowReader, including the cardinality mismatch failure path through the full read.AI Disclosure
Developed with the help of Claude Code, but I understand and support these changes.