advancedxy commented on code in PR #433:
URL: https://github.com/apache/datafusion-comet/pull/433#discussion_r1602408330
##########
core/src/execution/datafusion/spark_hash.rs:
##########
@@ -123,8 +115,31 @@ macro_rules! hash_array {
};
}
+macro_rules! hash_array_boolean {
+ ($array_type: ident, $column: ident, $hash_input_type: ident, $hashes:
ident) => {
+ let array = $column.as_any().downcast_ref::<$array_type>().unwrap();
+ if array.null_count() == 0 {
+ for (i, hash) in $hashes.iter_mut().enumerate() {
+ *hash = spark_compatible_murmur3_hash(
+ $hash_input_type::from(array.value(i)).to_le_bytes(),
+ *hash,
+ );
+ }
+ } else {
+ for (i, hash) in $hashes.iter_mut().enumerate() {
+ if !array.is_null(i) {
+ *hash = spark_compatible_murmur3_hash(
+ $hash_input_type::from(array.value(i)).to_le_bytes(),
+ *hash,
+ );
+ }
+ }
+ }
+ };
+}
Review Comment:
yeah. It could be used to support xxhash64 function.
--
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]