Feat Positional Delete by file path - #3024
Open
Kurtiscwright wants to merge 2 commits into
Open
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?
Adds path-based indexing of position delete files to
DeleteFileIndex, mirroring Java'sposDeletesByPath.pos_deletes_by_pathmap, replacing the commented-out TODO field.referenced_data_file: uses the explicitreferenced_data_filefield when set, otherwise infers the path from equalfile_pathcolumn bounds, matchingContentFileUtil.referencedDataFile. Unequal or missing bounds fall back to partition routing, so truncated bounds stay safe.PopulatedDeleteFileIndex::newmatches on content type first. Each delete lands in exactly one map.get_deletes_for_data_filegains a path-keyed lookup arm with the same greater-than-or-equal sequence filter as the partition arm and no partition spec id check, matching Java'sfindPathDeletesso path-keyed deletes survive partition evolution.A file-scoped position delete is now returned only for the data file it references instead of for every file in its partition, so scans load delete files in proportion to the files actually scanned. Deletion vector support (
dvByPathin Java) is out of scope.Are these changes tested?
Yes. Nine new unit tests alongside the two existing ones, all 11 pass: routing via the field and via bounds, fallback on unequal and one-sided bounds, path matching across partition spec ids, greater-than-or-equal
sequence semantics, composition of path-keyed, partition-keyed, and global deletes for one data file, multiple deletes under one path key, and a partitioned delete with a referenced path routing by path. The two pre-existing tests had a hardcoded
referenced_data_fileremoved from their builder so they continue to exercise partition routing.make checkpasses.AI Disclosure
The production code was written by hand, guided by an AI-assisted review of the Java reference implementation. Doc comments and unit tests were drafted with AI assistance and reviewed by me. All changes were verified locally with
make checkand the crate's test suite.