cloud-fan commented on code in PR #44527:
URL: https://github.com/apache/spark/pull/44527#discussion_r1438259318


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala:
##########
@@ -325,11 +325,17 @@ case class ExpressionEncoder[T](
   assert(serializer.forall(_.references.isEmpty), "serializer cannot reference 
any attributes.")
   assert(serializer.flatMap { ser =>
     val boundRefs = ser.collect { case b: BoundReference => b }
-    assert(boundRefs.nonEmpty,
-      "each serializer expression should contain at least one 
`BoundReference`")
+    assert(boundRefs.nonEmpty || isEmptyStruct(ser),

Review Comment:
   The change looks correct to me. If a column is StructType, the only reason 
that its serialize has no `BoundReference` is it's an empty struct.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to