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

    https://github.com/apache/spark/pull/15044#discussion_r86489106
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala
 ---
    @@ -119,18 +119,36 @@ object RowEncoder {
             "fromString",
             inputObject :: Nil)
     
    -    case t @ ArrayType(et, _) => et match {
    -      case BooleanType | ByteType | ShortType | IntegerType | LongType | 
FloatType | DoubleType =>
    -        // TODO: validate input type for primitive array.
    -        NewInstance(
    --- End diff --
    
    can we do the same thing here? i.e. special handling primitive array. I 
know we don't have the class information here, bu we can do it in the runtime:
    ```
    object ArrayData {
      def toArrayData(input: Any): ArrayData = input match {
        case a: Array[Boolean] => UnsafeArrayData.fromPrimitive(a)
        ...
        case other => new GenericArrayData(other)
      }
    }
    ```


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