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

    https://github.com/apache/spark/pull/20850#discussion_r175656666
  
    --- Diff: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/codegen/BufferHolder.java
 ---
    @@ -86,11 +88,39 @@ public void grow(int neededSize) {
         }
       }
     
    -  public void reset() {
    +  byte[] buffer() {
    +    return buffer;
    +  }
    +
    +  int getCursor() {
    +    return cursor;
    +  }
    +
    +  void incrementCursor(int val) {
    +    cursor += val;
    +  }
    +
    +  int pushCursor() {
    --- End diff --
    
    Since one `BufferHolder` is shared by multiple `UnsafeWriter`s, it seems to 
be simple to store cursors into `BufferHolders`.
    WDYT?


---

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

Reply via email to