erikerlandson commented on a change in pull request #28983:
URL: https://github.com/apache/spark/pull/28983#discussion_r451205658



##########
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:
       > could we remove the workaround now?
   
   IIUC, the original reason for that was some kind of graceful failure if 
someone coded an Aggregator wrong, which I assume could still happen.
   
   In retrospect, what would have helped me somewhat was either a comment in 
the exception message above, or at least code comment, saying something like 
"this exception is likely happening because an UnresolvedMapObject was 
serialized without being resolved".  




----------------------------------------------------------------
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]

Reply via email to