Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/15901#discussion_r88593388
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -164,23 +233,20 @@ case class Invoke(
"""
}
- val setIsNull = if (propagateNull && arguments.nonEmpty) {
- s"boolean ${ev.isNull} = ${obj.isNull} ||
${argGen.map(_.isNull).mkString(" || ")};"
- } else {
- s"boolean ${ev.isNull} = ${obj.isNull};"
- }
-
// If the function can return null, we do an extra check to make sure
our null bit is still set
// correctly.
val postNullCheck = if (ctx.defaultValue(dataType) == "null") {
s"${ev.isNull} = ${ev.value} == null;"
} else {
""
}
+
val code = s"""
${obj.code}
- ${argGen.map(_.code).mkString("\n")}
- $setIsNull
+ if (!${obj.isNull}) {
+ $argCode
+ }
+ boolean ${ev.isNull} = ${obj.isNull} || $resultIsNull;
--- End diff --
I know `resultIsNull` must be a member variable now, but in the future we
may make it a local variable if the argument code is not so long to exceed the
64kb limit. Here why not we assume `resultIsNull` can be local variable and
make us more robust?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]