Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/10391#discussion_r48537552
--- 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 --
same with `extractExpressions`, we should also strip the top-most `If` for
`constructExpression`
---
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]