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

    https://github.com/apache/spark/pull/20986#discussion_r179522301
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/UnsafeWriter.java
 ---
    @@ -156,6 +144,40 @@ public final void write(int ordinal, CalendarInterval 
input) {
         increaseCursor(16);
       }
     
    +  public final void write(int ordinal, UnsafeRow row) {
    +    writeAlignedBytes(ordinal, row.getBaseObject(), row.getBaseOffset(), 
row.getSizeInBytes());
    +  }
    +
    +  public final void write(int ordinal, UnsafeMapData map) {
    +    writeAlignedBytes(ordinal, map.getBaseObject(), map.getBaseOffset(), 
map.getSizeInBytes());
    +  }
    +
    +  public final void write(UnsafeArrayData array) {
    +    // Unsafe arrays both can be written as a regular array field or as 
part ofa  map. This makes
    +    // updating the offset and size dependent on the code path, this is 
why we currently do not
    +    // provide an method for writing unsafe arrays that also updates the 
size and offset.
    +    int numBytes = array.getSizeInBytes();
    +    grow(numBytes);
    +    Platform.copyMemory(
    +            array.getBaseOffset(),
    --- End diff --
    
    `array.getBaseObject()`?


---

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

Reply via email to