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

    https://github.com/apache/spark/pull/22646#discussion_r225807075
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -1115,9 +1126,38 @@ object SQLContext {
                 })
             }
         }
    -    def createConverter(cls: Class[_], dataType: DataType): Any => Any = 
dataType match {
    -      case struct: StructType => createStructConverter(cls, 
struct.map(_.dataType))
    -      case _ => CatalystTypeConverters.createToCatalystConverter(dataType)
    +    def createConverter(t: Type, dataType: DataType): Any => Any = (t, 
dataType) match {
    +      case (cls: Class[_], struct: StructType) =>
    --- End diff --
    
    Reusing `JavaTypeInference.serializerFor` would be great, but currently it 
behaves a little differently. At least it doesn't support 
`java.lang.Iterable[_]`, so we can't use it immediately. We need to extend it 
to support `Iterable` (and also `deserializerFor`).


---

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

Reply via email to