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

    https://github.com/apache/spark/pull/21732#discussion_r223690604
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala 
---
    @@ -135,19 +135,62 @@ object ScalaReflection extends ScalaReflection {
        * from ordinal 0 (since there are no names to map to).  The actual 
location can be moved by
        * calling resolve/bind with a new schema.
        */
    -  def deserializerFor[T : TypeTag]: Expression = {
    +  def deserializerFor[T : TypeTag]: Expression = cleanUpReflectionObjects {
         val tpe = localTypeOf[T]
         val clsName = getClassNameFromType(tpe)
         val walkedTypePath = s"""- root class: "$clsName"""" :: Nil
    -    val expr = deserializerFor(tpe, None, walkedTypePath)
    -    val Schema(_, nullable) = schemaFor(tpe)
    +    val Schema(dataType, tpeNullable) = schemaFor(tpe)
    +    val isOptionOfProduct = tpe.dealias <:< localTypeOf[Option[_]] &&
    --- End diff --
    
    can we reuse the `optionOfProductType`?


---

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

Reply via email to