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

    https://github.com/apache/spark/pull/13469#discussion_r65578425
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala
 ---
    @@ -52,8 +52,15 @@ object ExpressionEncoder {
         val cls = mirror.runtimeClass(tpe)
         val flat = !ScalaReflection.definedByConstructorParams(tpe)
     
    -    val inputObject = BoundReference(0, ScalaReflection.dataTypeFor[T], 
nullable = false)
    -    val serializer = ScalaReflection.serializerFor[T](inputObject)
    +    val inputObject = BoundReference(0, ScalaReflection.dataTypeFor[T], 
nullable = true)
    +    val nullSafeInput = if (flat) {
    +      inputObject
    --- End diff --
    
    I tried to also disallow null input object for flat type, but failed as 
some other tests already depend on this feature. e.g. `ParquetIOSuite.null and 
non-null strings`


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