fix(deletes): Implement filtering position delete files by file path - #2936
Open
brgr-s wants to merge 2 commits into
Open
fix(deletes): Implement filtering position delete files by file path#2936brgr-s wants to merge 2 commits into
brgr-s wants to merge 2 commits into
Conversation
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?
What changes are included in this PR?
The PR introduces (uncomments)
pos_deletes_by_pathinPopulatedDeleteFileIndexand populates theHashMap. To determine if a position delete file belongs in the map, it uses a helperposition_delete_targetthat investigatesreferenced_data_fileset? if yes, we know the delete file applies to that pathlower == upperfor the reserved fieldRESERVED_FIELD_ID_DELETE_FILE_PATH? If yes, we know that all entries point to the same pathAs a small ergonomic imrpovement it changes
eq_deletes_by_partitionandpod_deletes_by_partitionto take a(i32, Struct)as key, where thei32is thepartition_spec_idof the delete file.get_deletes_for_data_filecan then usepos_deletes_by_pathto lookup delete files that match that specificdata_file.PR also adds a debug trace that could be usefull to determine if a read on a table is slow or OOMs (see linked issue) due to a large number of created delete file references.
Are these changes tested?
I have added unit tests.
The change was also tested locally in conjuncture with PR #2620. The task was compacting a merge-on-read table with a huge number of delete files. The test scenario can be reproduced without PR #2620, see Issue #2935.
AI Disclosure
I used AI to investigate how Spark handles delete files, to review my changes and add more tests. I also used AI to write parts of the Issue and double-check the math.