Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19813#discussion_r154266910
  
    --- 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 --
    
    Is this initialization `s"$value = ${defaultValue(expr.dataType)};"` 
necessary?  
    I think `$value` will be always referred after `$value` is defined by an 
assignment generated at line 1039.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to