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

    https://github.com/apache/spark/pull/18958#discussion_r134115047
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnarBatch.java
 ---
    @@ -307,64 +293,69 @@ public void update(int ordinal, Object value) {
     
         @Override
         public void setNullAt(int ordinal) {
    -      assert (!columns[ordinal].isConstant);
    -      columns[ordinal].putNull(rowId);
    +      getColumnAsMutable(ordinal).putNull(rowId);
         }
     
         @Override
         public void setBoolean(int ordinal, boolean value) {
    -      assert (!columns[ordinal].isConstant);
    -      columns[ordinal].putNotNull(rowId);
    -      columns[ordinal].putBoolean(rowId, value);
    +      MutableColumnVector column = getColumnAsMutable(ordinal);
    +      column.putNotNull(rowId);
    +      column.putBoolean(rowId, value);
         }
     
         @Override
         public void setByte(int ordinal, byte value) {
    -      assert (!columns[ordinal].isConstant);
    -      columns[ordinal].putNotNull(rowId);
    -      columns[ordinal].putByte(rowId, value);
    +      MutableColumnVector column = getColumnAsMutable(ordinal);
    --- End diff --
    
    I'm a little afraid about this per-call type cast, but JVM should be able 
to optimize it perfectly, cc @kiszk 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to