moomindani opened a new pull request, #2790:
URL: https://github.com/apache/iceberg-rust/pull/2790

   ## Which issue does this PR close?
   
   - Part of #2789 (the non-breaking subset; preserving the original transform 
name for round-trip needs a `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 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to