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

    https://github.com/apache/spark/pull/11010#discussion_r51634787
  
    --- Diff: 
core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java ---
    @@ -441,30 +449,27 @@ public void safeLookup(Object keyBase, long 
keyOffset, int keyLength, Location l
           }
           if (longArray.get(pos * 2) == 0) {
             // This is a new key.
    -        loc.with(pos, hashcode, false);
    +        loc.with(pos, hash, false);
             return;
           } else {
             long stored = longArray.get(pos * 2 + 1);
    -        if ((int) (stored) == hashcode) {
    +        if ((int) (stored) == hash) {
               // Full hash code matches.  Let's compare the keys for equality.
    -          loc.with(pos, hashcode, true);
    +          loc.with(pos, hash, true);
               if (loc.getKeyLength() == keyLength) {
    -            final MemoryLocation keyAddress = loc.getKeyAddress();
    -            final Object storedkeyBase = keyAddress.getBaseObject();
    -            final long storedkeyOffset = keyAddress.getBaseOffset();
                 final boolean areEqual = ByteArrayMethods.arrayEquals(
                   keyBase,
                   keyOffset,
    -              storedkeyBase,
    -              storedkeyOffset,
    +              loc.getKeyBase(),
    +              loc.getKeyOffset(),
                   keyLength
                 );
                 if (areEqual) {
                   return;
                 } else {
    -              if (enablePerfMetrics) {
    +              //if (enablePerfMetrics) {
    --- End diff --
    
    restore


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to