You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/05/17 18:41:53 UTC
[GitHub] [spark] sunchao commented on a change in pull request #32553: [SPARK-35389][SQL] V2 ScalarFunction should support magic method with null arguments
sunchao commented on a change in pull request #32553:
URL: https://github.com/apache/spark/pull/32553#discussion_r633752218
##########
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:
I think it shouldn't matter. Here we're making sure that the magic method will always be invoked **regardless** of null-ness of the arguments.
For primitive types this has less significant meaning because even if `progagateNull` is true, `needNullCheck`
```
protected lazy val needNullCheck: Boolean = propagateNull && arguments.exists(_.nullable)
```
in `InvokeLike` also considers null-ness of arguments.
--
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org