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

 ##########
 File path: 
sql/core/src/main/java/org/apache/spark/sql/execution/UnsafeKVExternalSorter.java
 ##########
 @@ -141,9 +142,10 @@ public UnsafeKVExternalSorter(
 
         // Get encoded memory address
         // baseObject + baseOffset point to the beginning of the key data in 
the map, but that
-        // the KV-pair's length data is stored in the word immediately before 
that address
+        // the KV-pair's length data is stored at 2 * uaoSize bytes 
immediately before that address
 
 Review comment:
   The record format is:
   
    ```
   (total length) (key length) (key) (value) (8 byte pointer to next value)
          |             |
       uaoSize       uaoSize
   ```
   
   And we now get keyOffset, so we need back walk for 2 usao sizes to get the 
address.

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