andygrove opened a new issue, #547:
URL: https://github.com/apache/datafusion-comet/issues/547

   ### What is the problem the feature request solves?
   
   Here is the current xxhash64 implementation:
   
   ```rust
   pub(crate) fn spark_compatible_xxhash64<T: AsRef<[u8]>>(data: T, seed: u64) 
-> u64 {
       // TODO: Rewrite with a stateless hasher to reduce stack allocation?
       let mut hasher = XxHash64::with_seed(seed);
       hasher.write(data.as_ref());
       hasher.finish()
   }
   ```
   
   As the TODO comment states, it may be better to implement without stack 
allocation.
   
   Here is Spark's version for reference:
   
   ```java
     public static long hashInt(int input, long seed) {
       long hash = seed + PRIME64_5 + 4L;
       hash ^= (input & 0xFFFFFFFFL) * PRIME64_1;
       hash = Long.rotateLeft(hash, 23) * PRIME64_2 + PRIME64_3;
       return fmix(hash);
     }
   ```
   
   
   ### Describe the potential solution
   
   _No response_
   
   ### Additional context
   
   _No response_


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