Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13680#discussion_r79561292
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeMapData.java
 ---
    @@ -65,14 +65,15 @@ public UnsafeMapData() {
        * @param sizeInBytes the size of this map's backing data, in bytes
        */
       public void pointTo(Object baseObject, long baseOffset, int sizeInBytes) 
{
    -    // Read the numBytes of key array from the first 4 bytes.
    -    final int keyArraySize = Platform.getInt(baseObject, baseOffset);
    -    final int valueArraySize = sizeInBytes - keyArraySize - 4;
    +    // Read the numBytes of key array from the first 8 bytes.
    +    final long keyArraySize = Platform.getLong(baseObject, baseOffset);
    +    final long valueArraySize = sizeInBytes - keyArraySize - 8;
    --- End diff --
    
    check the `keyArraySize` first, then we can just write
    `final int valueArraySize = sizeInBytes - (int) keyArraySize - 8;`


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to