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

    https://github.com/apache/spark/pull/17436#discussion_r108947566
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnarBatch.java
 ---
    @@ -430,12 +430,15 @@ public int numValidRows() {
       /**
        * Sets (replaces) the column at `ordinal` with column. This can be used 
to do very efficient
        * projections.
    +   * Note: Caller must ensure that ColumnVector in column[ordinal] is not 
used in other places
        */
       public void setColumn(int ordinal, ColumnVector column) {
    -    if (column instanceof OffHeapColumnVector) {
    -      throw new UnsupportedOperationException("Need to ref count 
columns.");
    -    }
    +    ColumnVector oldColumn = columns[ordinal];
         columns[ordinal] = column;
    +    if (oldColumn instanceof OffHeapColumnVector) {
    --- End diff --
    
    we can call `oldColumn.close()` directly, as `OnHeapColumnVector.close` is 
no-op


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