Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/22749#discussion_r227678714
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala
---
@@ -58,12 +58,10 @@ object RowEncoder {
def apply(schema: StructType): ExpressionEncoder[Row] = {
val cls = classOf[Row]
val inputObject = BoundReference(0, ObjectType(cls), nullable = true)
- val serializer = serializerFor(AssertNotNull(inputObject, Seq("top
level row object")), schema)
- val deserializer = deserializerFor(schema)
+ val serializer = serializerFor(inputObject, schema)
+ val deserializer = deserializerFor(GetColumnByOrdinal(0,
serializer.dataType), schema)
--- End diff --
Ah, we need to access `serializer.dataType` here. So if we want to create
`GetColumnByOrdinal` in `deserializeFor`, we need to pass this data type too.
What do you think?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]