feat(scan): [3/N] read and apply V3 deletion vectors - #3035
Draft
mbutrovich wants to merge 14 commits into
Draft
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
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?
Draft PR, stacked on #2868. This is Task 3 of the deletion-vector read epic: reading and applying V3 deletion vectors during a scan.
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 same check Iceberg-Java does inBitmapPositionDeleteIndex.deserializeBitmap. Mismatch is aDataInvaliderror, not a silent wrong result.DeleteFileIndexnow indexes 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.PositionDeletesentry withcontent_offsetset but noreferenced_data_fileFileScanTaskDeleteFilegained arecord_countfield, populated from the manifest entry, used for the cardinality check above.DeleteVector::deserialize(from feat(delete-vector): [1/N] decode deletion-vector-v1 puffin blobs #2866) is now actually wired in; removed its#[allow(dead_code)].No data-file read path changes outside of deletion vectors. Existing position delete and equality delete handling is unchanged.
Are these changes tested?
Yes.
delete_file_index.rsfor: DV supersedes partition-scoped and path-scoped position deletes, DV coexists with equality deletes, rejecting a DV missingreferenced_data_file, rejecting duplicate DVs for one data file, rejecting a DV with a mismatched partition or stale sequence number.caching_delete_file_loader.rsfor: reading and applying a DV, reading an encrypted DV, rejecting a cardinality mismatch, and the coordinate/cardinality validation helpers directly.positional_deletes.rsreading a real 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.