Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19899#discussion_r155193147
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/arithmetic.scala
---
@@ -668,22 +681,35 @@ case class Greatest(children: Seq[Expression])
extends Expression {
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
val evalChildren = children.map(_.genCode(ctx))
- ctx.addMutableState(ctx.JAVA_BOOLEAN, ev.isNull)
- ctx.addMutableState(ctx.javaType(dataType), ev.value)
- def updateEval(eval: ExprCode): String = {
+ val isNull = ctx.freshName("greatestTmpIsNull")
--- End diff --
I am not sure about this. Because anyway, if `ev.isNull` is a global
variable, here the problem would still exist since we are declaring it in the
method (line 635). So I don't see how this changes/solves the problem.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]