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

    https://github.com/apache/spark/pull/10391#discussion_r48540861
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala
 ---
    @@ -35,7 +35,8 @@ object RowEncoder {
       def apply(schema: StructType): ExpressionEncoder[Row] = {
         val cls = classOf[Row]
         val inputObject = BoundReference(0, ObjectType(cls), nullable = true)
    -    val extractExpressions = extractorsFor(inputObject, schema)
    +    // We use an If expression to wrap extractorsFor result of StructType
    +    val extractExpressions = extractorsFor(inputObject, 
schema).asInstanceOf[If].falseValue
         val constructExpression = constructorFor(schema)
    --- End diff --
    
    Unlike `extractExpressions`, `constructExpression` hasn't been wrapped with 
an `If` here. Because there are two `constructorFor` methods, and the one 
wrapped with `If` is the second one.


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