Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/19813#discussion_r154267761 --- 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) + } addMutableState(javaType(expr.dataType), value, s"$value = ${defaultValue(expr.dataType)};") --- End diff -- Yeah, I think so.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org