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

   Fixes #405.
   
   `bit_get` accepts every integer type, including unsigned ones, but the 
kernel converted the value with `to_i64().unwrap()`. A `UInt64` above 
`i64::MAX` has no `i64` view, so `bit_get(arrow_cast('18446744073709551615', 
'UInt64'), 0)` panicked with `called Option::unwrap() on a None value` - in 
release builds as well, because the panic happens before the shift.
   
   `UInt64` now has its own kernel that shifts the value as `u64` and returns 
the bit, so an unsigned value from Arrow or Parquet data no longer panics. The 
kernels for the other integer types report an error instead of unwrapping if 
the conversion ever fails.
   
   Verification:
   
   - `cargo test -p datafusion-spark --lib bit_get`: 3 passed; the new test 
fails on `main` with the panic above.
   - `cargo test -p datafusion-spark-sqllogictest`: 518 of 518 test runs 
passed, including the new `UInt64` case in `bitwise/bit_get.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