-
Notifications
You must be signed in to change notification settings - Fork 551
feat(scan): [2/N] carry deletion-vector coordinates on FileScanTaskDeleteFile #2868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
06eca0e
feat(scan): carry deletion-vector coordinates on FileScanTaskDeleteFile
mbutrovich fb84ffc
fix after merging in main
mbutrovich 4e54829
fix public-api.txt
mbutrovich e17dfa3
fix test name
mbutrovich 37d2d73
Merge branch 'main' into dv-scan-task
mbutrovich 119da7a
Merge branch 'main' into dv-scan-task
mbutrovich 65b0198
Merge branch 'main' into dv-scan-task
mbutrovich 411f925
Merge branch 'main' into dv-scan-task
mbutrovich c5ed3cd
Merge branch 'main' into dv-scan-task
mbutrovich b4f96b1
Merge branch 'main' into dv-scan-task
mbutrovich ad2cb1b
update
mbutrovich fe2be89
Merge branch 'main' into dv-scan-task
mbutrovich 2b10404
Merge branch 'main' into dv-scan-task
mbutrovich 004449e
Address PR feedback
mbutrovich 936508c
Merge branch 'main' into dv-scan-task
mbutrovich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,6 +208,9 @@ impl From<&DeleteFileContext> for FileScanTaskDeleteFile { | |
| .with_file_type(ctx.manifest_entry.content_type()) | ||
| .with_partition_spec_id(ctx.partition_spec_id) | ||
| .with_equality_ids(ctx.manifest_entry.data_file.equality_ids.clone()) | ||
| .with_referenced_data_file(ctx.manifest_entry.data_file.referenced_data_file.clone()) | ||
| .with_content_offset(ctx.manifest_entry.data_file.content_offset) | ||
| .with_content_size_in_bytes(ctx.manifest_entry.data_file.content_size_in_bytes) | ||
| .with_key_metadata( | ||
| ctx.manifest_entry | ||
| .data_file | ||
|
|
@@ -239,6 +242,27 @@ pub struct FileScanTaskDeleteFile { | |
| #[builder(default)] | ||
| pub equality_ids: Option<Vec<i32>>, | ||
|
|
||
| /// For a deletion vector, the location of the data file whose rows it deletes. Required for | ||
| /// deletion vectors, and may also be set on a position delete file scoped to one data file. | ||
| #[serde(default)] | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| #[builder(default)] | ||
| pub referenced_data_file: Option<String>, | ||
|
|
||
| /// For a deletion vector, the offset of the blob within its Puffin file. Set only for | ||
| /// deletion vectors, where it locates the blob for direct access. | ||
| #[serde(default)] | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| #[builder(default)] | ||
| pub content_offset: Option<i64>, | ||
|
|
||
| /// For a deletion vector, the length in bytes of the blob within its Puffin file. Set | ||
| /// whenever `content_offset` is. | ||
| #[serde(default)] | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| #[builder(default)] | ||
| pub content_size_in_bytes: Option<i64>, | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #3035 I noticed we are also trying to add record_count for cardinality check. I'm leaning toward adding it here
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| /// Key metadata for encrypted delete files (Parquet Modular Encryption). | ||
| /// When present, the reader uses this to build `FileDecryptionProperties`. | ||
| /// | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a bit unclear, I'd recommend
also I noticed in #3035 , we are checking if a file is DV by checking
if content_offset.is_some(). I believe instead of that, we should checkisDv = (if type == PosDel && format == puffin). and we should throw errorif (isDV && (content_offset.is_none() || content_size_in_bytes.is_none()))because both of them are required for DVsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took your wording verbatim.
Agreed on the DV check: the rule should be
content == POSITION_DELETES && format == PUFFIN, and a DV missingcontent_offsetorcontent_size_in_bytesshould error instead of falling through to the position-delete path.FileScanTaskDeleteFilehas no format field today, onlyfile_type, which is why #3035 keys oncontent_offset.is_some()in the loader.DeleteFileIndexworks onDataFile, which hasfile_format(), so it can use the rule as written.Rather than land an unused field here, I'll do this in #3035: add
file_formattoFileScanTaskDeleteFile, switch both the index and the loader to the type + format check, and error when a DV is missing either coordinate.Let me know if you'd rather the field land in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
file_formattoFileScanTaskDeleteFilesounds good to me, we can do it in the next PR