Kevin-Li-2025 opened a new pull request, #23033:
URL: https://github.com/apache/datafusion/pull/23033

   ## Which issue does this PR close?
   
   - Closes #22696.
   
   ## Rationale for this change
   
   Spark `round` currently narrows `UInt64` inputs through `i64`. Values above 
`i64::MAX` therefore fail even when a non-negative scale makes rounding a 
no-op. The narrowing also prevents correct negative-scale rounding for the 
upper half of the `UInt64` domain.
   
   ## What changes are included in this PR?
   
   - Add a native `u64` HALF_UP rounding path with the same ANSI overflow and 
non-ANSI wrapping behavior as the signed implementation.
   - Use it for both scalar and array `UInt64` inputs.
   - Add helper-level coverage for large values and overflow behavior.
   - Add SQL regression coverage for `u64::MAX` with default/positive scales 
and a large negative-scale case.
   
   ## Are these changes tested?
   
   Yes:
   
   - `cargo test -p datafusion-spark function::math::round::tests --lib`
   - `cargo test -p datafusion-sqllogictest --test sqllogictests -- 
spark/math/round --test-threads 1`
   - `cargo clippy -p datafusion-spark --features core --all-targets -- -D 
warnings`
   - `cargo fmt --all -- --check`
   
   ## Are there any user-facing changes?
   
   Yes. Spark `round` now accepts `UInt64` values above `i64::MAX` and returns 
correct results instead of reporting a narrowing error. There are no public API 
changes.
   


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