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

    https://github.com/apache/spark/pull/21904#discussion_r205947481
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
 ---
    @@ -416,6 +416,29 @@ 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 e @ CaseWhen(branches, _) =>
    +        val newBranches = branches.foldLeft(List[(Expression, 
Expression)]()) {
    --- End diff --
    
    what about using `ArrayBuffer`? So we don't have to recreate the List at 
every iteration...


---

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

Reply via email to