Repository navigation
Conversation
Add a public ReachableFileUtil mirroring Java's ReachableFileUtil, and make ExpireSnapshots' reachable file cleanup use it for reading snapshot manifests and live file paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch has not been deployed
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.
Table maintenance work such as orphan file removal, purging a table, and rewriting table paths needs to find every file that table metadata references. Iceberg Java keeps this logic in
ReachableFileUtil. In C++ the equivalent code is private toExpireSnapshots, so it cannot be reused. This PR moves it into a publicReachableFileUtil, which those follow-up actions can build on.Approach:
ReachableFileUtil(util/reachable_file_util.{h,cc}) provides the same location helpers as Java:VersionHintLocation,MetadataFileLocations(optionally recursive),ManifestListLocations, andStatisticsFilesLocations(ForSnapshots).ReachableManifests,ManifestsForSnapshots,LiveFileLocations, andLiveFileLocationsForManifests. They take an optionalExecutor, like the rest of the code base.ReachableFileCleanupinExpireSnapshotsnow calls these helpers instead of its private copies. Error handling and executor use are unchanged.IncrementalFileCleanupis not touched.metadataFileLocations:Verification:
table_update_testlocally with Arrow 25.0.0 and AppleClang. All 1050 tests pass, and the remaining 33 are the format-version variants that were already skipped. This includes the newReachableFileUtilTestcases and every existingExpireSnapshots*test.pre-commitpasses, including the regeneratedcpp20_compatibility_internal.h.ICEBERG_CXX20_COMPATbuild, and the other test executables. CI covers these.Known limitations, out of scope here:
TableMetadataUtil::Readrejects v1 metadata that lists manifests inline without amanifest-list. The recursive walk skips such files.RunTasksParalleldoes not wait for tasks the executor already accepted if a laterExecutor::Submitthrows. That code is shared with the existing callers and is unchanged by this PR.AI disclosure: Claude Code (Claude Opus) wrote the code, tests, and this description. It was reviewed by a Claude subagent and by OpenAI Codex (
codex review) over several rounds, and their findings were addressed. The human contributor will state what they reviewed.