cloud-fan commented on a change in pull request #28195: 
[SPARK-31425][SQL][CORE] 
UnsafeKVExternalSorter/VariableLengthRowBasedKeyValueBatch should also respect 
UnsafeAlignedOffset
URL: https://github.com/apache/spark/pull/28195#discussion_r407950682
 
 

 ##########
 File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/VariableLengthRowBasedKeyValueBatch.java
 ##########
 @@ -99,9 +102,10 @@ public UnsafeRow getValueFromKey(int rowId) {
       getKeyRow(rowId);
     }
     assert(rowId >= 0);
+    int uaoSize = UnsafeAlignedOffset.getUaoSize();
     long offset = keyRow.getBaseOffset();
     int klen = keyRow.getSizeInBytes();
-    int vlen = Platform.getInt(base, offset - 8) - klen - 4;
+    int vlen = UnsafeAlignedOffset.getSize(base, offset - uaoSize - uaoSize) - 
klen - uaoSize;
 
 Review comment:
   `- uaoSize * 2`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to