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

    https://github.com/apache/spark/pull/18014#discussion_r120311436
  
    --- Diff: 
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OnHeapColumnVector.java
 ---
    @@ -386,6 +425,35 @@ public void putArray(int rowId, int offset, int 
length) {
       }
     
       @Override
    +  public void putArray(int rowId, Object src, int srcOffset, int 
dstOffset, int numElements) {
    +    DataType et = type;
    +    reserve(dstOffset + numElements);
    +    if (et == DataTypes.BooleanType || et == DataTypes.ByteType) {
    +      Platform.copyMemory(
    +        src, srcOffset, byteData, Platform.BYTE_ARRAY_OFFSET + dstOffset, 
numElements);
    +    } else if (et == DataTypes.BooleanType || et == DataTypes.ByteType) {
    +      Platform.copyMemory(
    +        src, srcOffset, shortData, Platform.SHORT_ARRAY_OFFSET + dstOffset 
* 2, numElements * 2);
    +    } else if (et == DataTypes.IntegerType || et == DataTypes.DateType ||
    +      DecimalType.is32BitDecimalType(type)) {
    +      Platform.copyMemory(
    +        src, srcOffset, intData, Platform.INT_ARRAY_OFFSET + dstOffset * 
4, numElements * 4);
    +    } else if (type instanceof LongType || type instanceof TimestampType ||
    +      DecimalType.is64BitDecimalType(type)) {
    +      Platform.copyMemory(
    +        src, srcOffset, longData, Platform.LONG_ARRAY_OFFSET + dstOffset * 
8, numElements * 8);
    +    } else if (et == DataTypes.FloatType) {
    +      Platform.copyMemory(
    +        src, srcOffset, floatData, Platform.FLOAT_ARRAY_OFFSET + dstOffset 
* 4, numElements * 4);
    +    } else if (et == DataTypes.DoubleType) {
    +      Platform.copyMemory(
    +        src, srcOffset, doubleData, Platform.DOUBLE_ARRAY_OFFSET + 
dstOffset * 8, numElements * 8);
    +    } else {
    +      throw new RuntimeException("Unhandled " + type);
    --- End diff --
    
    @cloud-fan I agree that `ColumnVector.Array.getArray` returns the same 
instance in `ColumnVector.resultArray`. This is good for one-dimensional array.
    In my understanding, we have to get `ColumnVector` from this instance to 
supporting nested array. However, current `ColumnVector.Array` does not have 
getter for `ColumnVector`. It is hard to implement nested array in current 
`ColumnVector` implementation. I correct? Or, do you have any idea to enhance 
`ColumnVector`?
    
    I would appreciate it if we have a F2F chat at Moscone center on Tuesday.


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