Feat/hadoop version hint#964
Merged
Merged
Conversation
Implement readVersionHint, writeVersionHint, scanForward, and findVersion with three-tier fallback: read hint and validate, scan forward, fall back to directory listing. Relates to apache#798 Depends-on: apache#953 (scaffold) Depended-on-by: PR 4 (table CRUD)
…alidation
scanForward and findVersion hint validation only checked for
v{N}.metadata.json, missing gzip-compressed v{N}.gz.metadata.json
files. This could return a stale version when metadata compression
was enabled. Extract metadataVersionExists helper that checks both
formats.
laskoviymishka
approved these changes
May 1, 2026
Contributor
laskoviymishka
left a comment
There was a problem hiding this comment.
@tanmayrauth let's rename PR to make it consistent, commit name sound right to me:
feat(catalog): add version-hint management for Hadoop catalog
Once renamed - good to merge
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.
2: Version-hint management
Implement readVersionHint (reads the integer from version-hint.text, returns 0 on any error), writeVersionHint (writes to a temp file then renames, best-effort with errors logged but not returned), and findVersion with the full three-tier fallback: read hint and validate the file exists, scan forward from the hinted version until no file is found, and if there's no hint at all, list the metadata directory to find the max version then scan forward. Tests cover round-trip read/write, missing hint, corrupt hint, stale hint (v3 exists but hint says 2), scan-forward behavior, directory listing fallback, and the no-metadata-files case.
Relates to #798