stefankandic commented on code in PR #44527:
URL: https://github.com/apache/spark/pull/44527#discussion_r1438299590
##########
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),
+ "each serializer expression should contain at least one `BoundReference`
" +
+ "or be an empty struct")
Review Comment:
updated! let me know if you think it's clearer now
--
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]