andygrove commented on code in PR #546: URL: https://github.com/apache/datafusion-comet/pull/546#discussion_r1638984525
########## core/src/execution/datafusion/spark_hash.rs: ########## @@ -85,11 +85,16 @@ pub(crate) fn spark_compatible_murmur3_hash<T: AsRef<[u8]>>(data: T, seed: u32) // safety: // avoid boundary checking in performance critical codes. // all operations are guaranteed to be safe + // data is &[u8] so we do not need to check for proper alignment unsafe { - let mut h1 = hash_bytes_by_int( - std::slice::from_raw_parts(data.get_unchecked(0), len_aligned), - seed, - ); + let mut h1 = if len_aligned > 0 { Review Comment: Without this check we were hitting a debug assertion on the call to `get_unchecked(0)` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org