Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21850#discussion_r205505495
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
 ---
    @@ -414,6 +414,9 @@ object SimplifyConditionals extends Rule[LogicalPlan] 
with PredicateHelper {
             // these branches can be pruned away
             val (h, t) = branches.span(_._1 != TrueLiteral)
             CaseWhen( h :+ t.head, None)
    +
    +      case CaseWhen(Seq((cond, trueValue)), elseValue) =>
    +        If(cond, trueValue, elseValue.getOrElse(Literal(null, 
trueValue.dataType)))
    --- End diff --
    
    I don't think `If` is faster than `CaseWhen`, can you explain more about 
"further optimization"?
    



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to