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

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

Conversation

@moomindani

@moomindani moomindani commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

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 proposed for PyIceberg 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

Copy link
Copy Markdown
Contributor Author

Gentle ping — this has been open for ~3 weeks with CI green and no review yet.

It's a small, self-contained change: FromStr for Transform currently errors on any unrecognized transform name, but the v3 spec requires readers to read tables with unknown transforms and ignore them, so a table using a transform this version doesn't know about is unreadable today. One file, spec/transform.rs.

Scoped deliberately to the non-breaking subset — preserving the original name for round-trip needs a Transform::Unknown(String) API discussion, which stays in #2789.

@blackmwk you've reviewed most of the recent spec changes — would you mind taking a look when you have a moment? Part of #2411.

@moomindani
moomindani force-pushed the unknown-transform-parse-fallback branch from af9372b to 0823b86 Compare August 21, 2026 16:26
@moomindani
moomindani force-pushed the unknown-transform-parse-fallback branch from 0823b86 to 56aca78 Compare September 15, 2026 23:39
@moomindani

Copy link
Copy Markdown
Contributor Author

Rebased onto current main — this had drifted 85 commits behind and was conflicting, so no CI had run on it for weeks. Now mergeable and green.

Verified locally with the pinned toolchain: cargo test -p iceberg --lib 1750 passed, cargo clippy --all-targets --all-features -- -D warnings clean, cargo fmt --check clean. The rebase conflict was only in the test module, where main and this branch had each appended tests at the same place; both sets are kept.

@CTTY @kevinjqliu this is a small spec-conformance fix — v3 readers are required to read tables with unknown transforms rather than fail parsing, matching Java's Transforms.fromString. It has had no review since it was opened on 9 July. Would either of you take a look?

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Oct 16, 2026
moomindani and others added 2 commits October 16, 2026 16:56
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.
@moomindani
moomindani force-pushed the unknown-transform-parse-fallback branch from 56aca78 to 47398ef Compare October 16, 2026 08:00
@moomindani

Copy link
Copy Markdown
Contributor Author

Not stale. Rebased onto current main again to clear a conflict with the invalid_data! macro from #2928; the parameter-parsing helper now uses it too. cargo test -p iceberg --lib 1978 passed, clippy and fmt clean, public API unchanged.

@laskoviymishka you reviewed and merged the recent spec/transform.rs changes (#2928, #3243); would you take a look? It is one file.

@github-actions github-actions Bot removed the stale label Oct 17, 2026

This branch has not been deployed

No deployments
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