JeonDaehong opened a new pull request, #3358: URL: https://github.com/apache/iceberg-rust/pull/3358
## Which issue does this PR close? - Closes #3326. ## What changes are included in this PR? `Datum::to_human_string` now formats `float` / `double` like Java's `Float.toString` / `Double.toString` (JDK 19+): - at least one digit after the point (`1.0`, `-0.0`) - plain decimal for `1e-3 <= |v| < 1e7`, otherwise `1.0E7` / `1.0E-5` - `Infinity` / `-Infinity` - at least two significant digits, and ties go to the even digit (`4.9E-324`, `2097152.2` for `2097152.25f32`) `Display for Datum` is unchanged, so only partition paths and the `partitions.<path>` summary keys change. JDK 17 and older print some values differently (e.g. `1.0E23` as `9.999999999999999E22`); this follows JDK 19+. Related: #3352 changes the same function for timestamp/binary values. Whichever merges first, I'll rebase the other. ## Are these changes tested? Yes. - New tests in `transform.rs` and `partition.rs`. Expected values come from running Java 21 and iceberg-java's `PartitionSpec.partitionToPath`. - I also compared the formatter against Java 21 for ~1.8M values (random bits, powers of 2 and 10 with neighbours, subnormals, values around 1e-3/1e7): 0 mismatches. `cargo test -p iceberg --lib` (1843 passed), `cargo clippy -p iceberg --all-targets -- -D warnings` and `cargo fmt --check` are clean. ## AI Disclosure I used Claude Code to help draft the implementation and tests. I generated the expected values by running Java myself, and I reviewed the code and ran the tests and lints above. -- 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]
