Parse unrecognized transform names as Transform::Unknown#2790
Open
moomindani wants to merge 2 commits into
Open
Parse unrecognized transform names as Transform::Unknown#2790moomindani wants to merge 2 commits into
moomindani wants to merge 2 commits into
Conversation
Per the V3 spec, readers are required to read tables with unknown transforms, ignoring them. FromStr for Transform returned an error for any unrecognized name, so table metadata using a transform iceberg-rust does not know failed to load. Match Java's Transforms.fromString: only exactly well-formed known transforms parse as known; everything else parses as Transform::Unknown. Well-formed parameters that overflow u32 still error.
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?
Transform::Unknown(String)API discussion and stays tracked there).What changes are included in this PR?
The V3 spec requires readers to read tables with unknown transforms, ignoring them.
FromStr for Transformreturned an error for any unrecognized transform name, so loading table metadata that uses a transform iceberg-rust does not know failed entirely.This changes parsing to match Java's
Transforms.fromString: a string that is not an exactly well-formed known transform parses asTransform::Unknowninstead of erroring. This covers unknown names (zorder), names sharing a prefix with known transforms (bucketv2[4]), malformed parameter shapes (bucket[abc], barebucket), and loose forms the previous parser accepted by accident (bucket10, previously parsed asBucket(10)). Well-formed parameters that overflowu32still error, matching Java's behavior for the equivalent input.Interaction with #2474 noted: that PR tightens parameter validation of known transforms; the two changes are semantically compatible (well-formed known-transform parameters are validated, everything else is unknown).
This is the Rust counterpart of the behavior PyIceberg implemented in apache/iceberg-python#3630.
Are these changes tested?
Yes — new unit tests in
spec/transform.rs: known-transform parsing, the unknown fallback across nine unknown/malformed inputs, and the overflow error case.cargo test -p iceberg --lib spec::transform,cargo fmt --check, andcargo clippy -p iceberg --libpass locally.This pull request and its description were written by Claude Fable 5.