mbutrovich opened a new pull request, #2783: URL: https://github.com/apache/iceberg-rust/pull/2783
## Which issue does this PR close? - Closes #. ## What changes are included in this PR? `Datum::to()` had no conversion between `float` and `double`, so binding a predicate whose literal type differed from the column type failed with `Can't convert datum from double type to float type`. This is common because engines often carry a floating point literal as a double even when the column is a float. This PR adds the two missing arms: - `Double -> Float`: narrows through a new `f64_to_f32` helper that returns `AboveMax` / `BelowMin` when the value is outside the finite float range, matching the existing integer narrowing helpers (`i64_to_i32`, `i128_to_i64`). A plain `as f32` cast would saturate to `+/-inf` and change comparison results, so the sentinels let predicate binding resolve the comparison correctly. - `Float -> Double`: widens losslessly. ## Are these changes tested? Yes. Four unit tests in `spec/values/tests.rs` cover the in range narrowing, the above max and below min cases, and the widening. The `AboveMax` / `BelowMin` handling is already exercised by the existing predicate binding tests in `expr::predicate`. -- 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]
