sunchao commented on a change in pull request #32553:
URL: https://github.com/apache/spark/pull/32553#discussion_r633803543



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2204,11 +2204,12 @@ class Analyzer(override val catalogManager: 
CatalogManager)
         findMethod(scalarFunc, MAGIC_METHOD_NAME, argClasses) match {
           case Some(m) if Modifier.isStatic(m.getModifiers) =>
             StaticInvoke(scalarFunc.getClass, scalarFunc.resultType(),
-              MAGIC_METHOD_NAME, arguments, returnNullable = 
scalarFunc.isResultNullable)
+              MAGIC_METHOD_NAME, arguments, propagateNull = false,

Review comment:
       Ah I see what you mean, thanks. Seems we should allow users to define 
magic method with boxed primitive types for this case? We could also follow the 
behavior of 
[ScalaUDF](https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDF.scala#L32)
 and returns null if any of the primitive type parameter is nullable and the 
input is null, however currently `InvokeLike` cannot handle the case where a 
subset of the input types are of primitive nullable type.




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