fix(table): validate required metadata identity fields - #1867
Merged
zeroshade merged 1 commit intoAug 26, 2026
Merged
Conversation
zeroshade
approved these changes
Aug 25, 2026
zeroshade
left a comment
Member
There was a problem hiding this comment.
LGTM, just need to rebase onto main to pick up the linting fixes
Revanth14
force-pushed
the
fix/table-metadata-required-identity-fields
branch
from
August 25, 2026 17:01
4f36a14 to
3469104
Compare
Contributor
Author
@zeroshade |
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.
Description
This PR validates required identity fields when parsing table metadata:
locationfor format versions 1–3.table-uuidfor format versions 2–3.table-uuid.Validation is performed at the JSON parsing boundary rather than in the shared metadata validator. This keeps the existing create-via-commit staging flow valid, where metadata may temporarily have an empty location before it is persisted.
Why are these changes needed?
Previously, invalid table metadata was silently accepted:
"".uuid.Nil.This could cause location providers to produce bogus relative paths and could make
assert-table-uuidrequirements incorrectly match unrelated UUID-less tables.The behavior now matches the Iceberg requirements for the currently supported format versions. Two deliberate deltas from Java:
"location": ""and an explicitly all-zerostable-uuidare rejected here, where Java only checks for null. Both are covered by tests. If format v4 support is added, location validation will need to account for location becoming optional.Note: this is a behavior change. Metadata that previously parsed successfully may now return an error.
Real-world compatibility risk is limited:
NewMetadata.SetFormatVersion.Malformed externally produced metadata and the direct v1-to-v2 conversion path are the primary cases affected. This behavior change may warrant a release note.
Tests
Added coverage for:
Validated with:
go test ./... -count=1go vet -tags=integration ./...Closes #1864