Skip to content

Parse unrecognized transform names as Transform::Unknown#2790

Open
moomindani wants to merge 2 commits into
apache:mainfrom
moomindani:unknown-transform-parse-fallback
Open

Parse unrecognized transform names as Transform::Unknown#2790
moomindani wants to merge 2 commits into
apache:mainfrom
moomindani:unknown-transform-parse-fallback

Conversation

@moomindani

Copy link
Copy Markdown

Which issue does this PR close?

What changes are included in this PR?

The V3 spec requires readers to read tables with unknown transforms, ignoring them. FromStr for Transform returned 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 as Transform::Unknown instead of erroring. This covers unknown names (zorder), names sharing a prefix with known transforms (bucketv2[4]), malformed parameter shapes (bucket[abc], bare bucket), and loose forms the previous parser accepted by accident (bucket10, previously parsed as Bucket(10)). Well-formed parameters that overflow u32 still 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, and cargo clippy -p iceberg --lib pass locally.

This pull request and its description were written by Claude Fable 5.

moomindani and others added 2 commits July 9, 2026 13:11
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant