Parse unrecognized transform names as Transform::Unknown - #2790
moomindani wants to merge 2 commits into
Conversation
|
Gentle ping — this has been open for ~3 weeks with CI green and no review yet. It's a small, self-contained change: Scoped deliberately to the non-breaking subset — preserving the original name for round-trip needs a @blackmwk you've reviewed most of the recent |
af9372b to
0823b86
Compare
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.
0823b86 to
56aca78
Compare
|
Rebased onto current Verified locally with the pinned toolchain: @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 |
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.