spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #19901: [SPARK-22705][SQL] Case, Coalesce, and In use les...
Date Wed, 06 Dec 2017 01:40:32 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19901#discussion_r155127135
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/conditionalExpressions.scala
---
    @@ -180,13 +180,13 @@ case class CaseWhen(
       }
     
       override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
    -    // This variable represents whether the first successful condition is met or not.
    -    // It is initialized to `false` and it is set to `true` when the first condition
which
    -    // evaluates to `true` is met and therefore is not needed to go on anymore on the
computation
    +    // This variable represents whether the condition is met with true/false or not met.
    +    // It is initialized to -1 and it is set to 0 or 1 when the condition which evaluates
to
    +    // `false` or `true` is met and therefore is not needed to go on anymore on the computation
         // of the following conditions.
         val conditionMet = ctx.freshName("caseWhenConditionMet")
    -    ctx.addMutableState(ctx.JAVA_BOOLEAN, ev.isNull)
    -    ctx.addMutableState(ctx.javaType(dataType), ev.value)
    +    val value = ctx.freshName("value")
    --- End diff --
    
    `tmpResult`?


---

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


Mime
View raw message