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

    https://github.com/apache/spark/pull/18260#discussion_r121297255
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java
 ---
    @@ -438,10 +401,9 @@ public void loadBytes(ColumnVector.Array array) {
       protected void reserveInternal(int newCapacity) {
         int oldCapacity = (this.data == 0L) ? 0 : capacity;
         if (this.resultArray != null) {
    -      this.lengthData =
    -          Platform.reallocateMemory(lengthData, oldCapacity * 4, 
newCapacity * 4);
    -      this.offsetData =
    -          Platform.reallocateMemory(offsetData, oldCapacity * 4, 
newCapacity * 4);
    +      // need 2 ints as offset and length for each array.
    +      this.data = Platform.reallocateMemory(data, oldCapacity * 8, 
newCapacity * 8);
    +      putInt(0, 0);
    --- End diff --
    
    I had second thought that `putArrayOffsetAndLength(0,0,0)` is better for 
the purpose of the guard?


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