Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19899#discussion_r155214885
--- 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 --
yes, thus if it is declared as global variable, we still have a global
variable with the same name of a local one. Am I missing something?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]