andygrove opened a new pull request, #5083: URL: https://github.com/apache/datafusion-comet/pull/5083
## Summary - Native `cast_boolean_to_decimal` ignored `EvalMode` and unconditionally raised `NUMERIC_VALUE_OUT_OF_RANGE` when `10^scale` did not fit the target precision. Spark's `Cast` delegates to `Decimal.toPrecision` with `nullOnOverflow = !ansiEnabled`, so legacy and try modes should return NULL and only ANSI should throw. - Thread `EvalMode` through the cast: legacy/try produce NULL for `true` when the target precision is too small; ANSI still errors. `false` continues to map to 0 and always fits. - Adds Rust unit tests covering all three eval modes and a `CometCastSuite` regression test for DECIMAL(1,1) / (2,2) / (3,3) targets (existing suite only used non-overflowing targets like DECIMAL(10,2)). Fixes #5068 ## Test plan - [x] `cargo test -p datafusion-comet-spark-expr --lib conversion_funcs::boolean` - [x] `cargo clippy -p datafusion-comet-spark-expr --lib --tests` - [ ] `./mvnw test -Dsuites="org.apache.comet.CometCastSuite" -Dtest=none` -- 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]
