Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/19813#discussion_r153847727
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
---
@@ -1028,12 +1053,18 @@ class CodegenContext {
// 2. Less code.
// Currently, we will do this for all non-leaf only expression trees
(i.e. expr trees with
// at least two nodes) as the cost of doing it is expected to be low.
- addMutableState(JAVA_BOOLEAN, isNull, s"$isNull = false;")
+ if (expr.nullable) {
+ addMutableState(JAVA_BOOLEAN, isNull, s"$isNull = false;")
--- End diff --
nit: can we eliminate `s"$isNull = false;"` to assign Java default value.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]