compiler-segfault opened a new pull request, #414:
URL: https://github.com/apache/datafusion-spark/pull/414

   Fixes #404.
   
   `width_bucket` computed `num_buckets + 1` before checking any bound on 
`num_buckets`. For `num_buckets = 9223372036854775807` that overflows: a debug 
build panics with `attempt to add with overflow`, and a release build wraps to 
`i64::MIN`. Spark returns NULL for that value, because `WidthBucket.isNull` is 
true when `numBucket == Long.MaxValue`.
   
   The kernel now returns null instead of computing the overflowing value, and 
the shared `bucket_from_f64` helper has the same guard for the interval paths.
   
   Verification:
   
   - `cargo test -p datafusion-spark --lib width_bucket`: 22 passed; the new 
test fails on `main` with `attempt to add with overflow`.
   - `cargo test -p datafusion-spark-sqllogictest`: 518 of 518 test runs 
passed, including the new case in `math/width_bucket.slt`.
   - `cargo fmt --all -- --check` and `cargo clippy -p datafusion-spark 
--all-targets -- -D warnings` are clean.
   
   The text above was drafted with an AI assistant; I ran the tests myself.
   


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