fix(spec): tolerate DuckDB manifest entry schemas#2791
Open
fm100 wants to merge 1 commit into
Open
Conversation
Contributor
|
In general, I think its a good idea for the parsing logic to be more tolerable, it allows us to fix forward malformed metadata (like this exact case). And we should still enforce spec conformance somewhere in the stack 😄 I'll take a look at the PR when i get some time |
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?
This PR makes manifest metadata parsing more tolerant of manifests written by affected versions of the DuckDB Iceberg extension.
According to the Iceberg spec, the Avro manifest metadata
schemakey should contain the table schema at the time the manifest was written. A DuckDB Iceberg extension bug wrote the manifest entry schema into that key instead of the table schema. DuckDB fixed this in duckdb/duckdb-iceberg#1020, but that fix has not been released yet.Even after a fixed DuckDB Iceberg extension release is available, tables created by the buggy versions can still contain manifests with the bad metadata. Reopening those tables with a newer writer does not automatically rewrite existing manifest files, so readers need to tolerate the malformed metadata to read those existing tables.
For unpartitioned manifests, Iceberg Rust can still read the manifest entries without the table schema. This PR falls back to an empty schema when:
schemavalue cannot be parsed as an Iceberg table schemaThe fallback remains limited to unpartitioned manifests because partitioned manifests need the table schema to bind partition source fields.
Are these changes tested?
Yes. This PR adds a unit test covering manifest metadata with a DuckDB-style manifest entry schema for an unpartitioned table.
Tested with:
cargo test -p iceberg test_manifest_metadata_with_manifest_entry_schema_for_unpartitioned_table