Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/15901#discussion_r88646348
--- 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 --
> You are assuming that the argument code is not so long, so use local
variable without splitting evaluations? (could also make the argument variable
as local variable)
This is what I mean. We can generate code first and see if it exceeds the
64kb limitation, so logically we do have a chance to use local variables.
---
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]