Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19720#discussion_r150406531
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala
---
@@ -90,7 +86,12 @@ case class Coalesce(children: Seq[Expression]) extends
Expression {
}
}
"""
- }.mkString("\n"))
+ }
+
+ ev.copy(code = s"""
+ ${ev.isNull} = true;
+ ${ev.value} = ${ctx.defaultValue(dataType)};
+ ${ctx.splitExpressions(ctx.INPUT_ROW, evals)}""")
--- End diff --
This is the reason why I put `ev.isNull` and `ev.value` as attributes of
the generated class, in this way they can be used as before in the individual
functions. If you want, I can try and use the other overloaded method
`splitExpressions` without passing the input row to it.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]