erikerlandson commented on a change in pull request #28983:
URL: https://github.com/apache/spark/pull/28983#discussion_r451206954
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
##########
@@ -678,6 +678,9 @@ object MapObjects {
elementType: DataType,
elementNullable: Boolean = true,
customCollectionCls: Option[Class[_]] = None): MapObjects = {
+ if (function == null) {
+ throw new UnsupportedOperationException("Cannot instantiate MapObjects
with null function")
+ }
Review comment:
The particular reason this happened to me should no longer be possible.
I'm not aware of any other path for it to happen, but leaving an informative
exception message, or at least a code comment to annotate the non-null
assertion, seems like good defensive programming.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]