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

   ## Which issue does this PR close?
   
   - Closes #3815.
   
   ## What changes are included in this PR?
   
   `Datum::to` no longer converts a decimal to `long`, which matches Java's 
`DecimalLiteral.to` 
([Literals.java#L497-L504](https://github.com/apache/iceberg/blob/06f1574471c4603443a67f78af72e4e1d0aeacea/api/src/main/java/org/apache/iceberg/expressions/Literals.java#L497-L504)).
 Two inputs that worked before now fail to bind as well. A scale-0 decimal such 
as `12345` used to convert to the right `long`. A decimal outside the `long` 
range used to become `AboveMax` or `BelowMin`, which binding folds to 
`AlwaysTrue` or `AlwaysFalse` 
([predicate.rs#L421-L449](https://github.com/apache/iceberg-rust/blob/6cca8cdec6881d057581bdf9cc21c3ad426c0283/crates/iceberg/src/expr/predicate.rs#L421-L449)).
   
   Neither engine integration builds decimal literals for predicates today 
([datafusion-iceberg](https://github.com/apache/datafusion-iceberg/blob/401757923d354c4205afb8f7e0838e8e04bb852d/crates/datafusion/src/read/predicate.rs#L330-L369),
 
[Comet](https://github.com/apache/datafusion-comet/blob/cebb41acb2f420e3e624dbf8a69acc5ce414edbb/native/core/src/execution/planner.rs#L3077-L3082)).
 The datafusion-iceberg TODO to add them targets decimal columns, which use the 
decimal-to-decimal conversion this PR keeps.
   
   ## Are these changes tested?
   
   Yes, `test_datum_decimal_convert_to_long_fails` in 
`crates/iceberg/src/spec/values/tests.rs`.
   
   ## AI Disclosure
   
   I wrote this PR with help from Claude but understand and support the core 
approach, implementation, and test coverage.
   


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