fix: handle missing schema_id in ObjectCache for Iceberg v1 tables#2279
Closed
vovacf201 wants to merge 1 commit intoapache:mainfrom
Closed
fix: handle missing schema_id in ObjectCache for Iceberg v1 tables#2279vovacf201 wants to merge 1 commit intoapache:mainfrom
vovacf201 wants to merge 1 commit intoapache:mainfrom
Conversation
ObjectCache::get_manifest_list panics on .unwrap() when building the cache key for snapshots without a schema_id (Iceberg v1 format tables don't require this field). Fall back to table_metadata.current_schema_id() when snapshot.schema_id() is None.
0c5bcc7 to
1ba883e
Compare
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?
N/A (discovered in production via panic stack trace)
What changes are included in this PR?
ObjectCache::get_manifest_list panics when building the cache key for snapshots that don't have a schema_id set. This happens with Iceberg v1 format tables, where schema_id is optional on snapshots.
The fix falls back to table_metadata.current_schema_id() when snapshot.schema_id() returns None, consistent with how Snapshot::schema() resolves the schema elsewhere in the codebase.
Are these changes tested?
Existing test_get_manifest_list_and_manifest_from_default_cache covers the cache path but uses v2 metadata where schema_id is always present.