Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19222#discussion_r174334386
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java ---
    @@ -49,55 +50,81 @@ public static int hashInt(int input, int seed) {
       }
     
       public int hashUnsafeWords(Object base, long offset, int lengthInBytes) {
    -    return hashUnsafeWords(base, offset, lengthInBytes, seed);
    +    return hashUnsafeWordsBlock(MemoryBlock.allocateFromObject(base, 
offset, lengthInBytes), seed);
    +  }
    +
    +  public static int hashUnsafeWordsBlock(MemoryBlock base, int seed) {
    +    // This is based on Guava's 
`Murmur32_Hasher.processRemaining(ByteBuffer)` method.
    +    int lengthInBytes = (int)base.size();
    --- End diff --
    
    Since this requires `int`, I wil add cast check.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to