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 #20139: [SPARK-22944][SQL] improve FoldablePropagation
Date Wed, 03 Jan 2018 16:14:19 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20139#discussion_r159463254
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
---
    @@ -530,38 +533,50 @@ object FoldablePropagation extends Rule[LogicalPlan] {
         if (foldableMap.isEmpty) {
           plan
         } else {
    -      var stop = false
           CleanupAliases(plan.transformUp {
    -        // A leaf node should not stop the folding process (note that we are traversing
up the
    -        // tree, starting at the leaf nodes); so we are allowing it.
    -        case l: LeafNode =>
    -          l
    -
             // We can only propagate foldables for a subset of unary nodes.
    -        case u: UnaryNode if !stop && canPropagateFoldables(u) =>
    +        case u: UnaryNode if canPropagateFoldables(u) =>
    --- End diff --
    
    ah good catch!


---

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


Mime
View raw message