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

    https://github.com/apache/spark/pull/20069#discussion_r160910495
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -851,7 +851,7 @@ object PushDownPredicate extends Rule[LogicalPlan] with 
PredicateHelper {
     
         case filter @ Filter(condition, union: Union) =>
           // Union could change the rows, so non-deterministic predicate can't 
be pushed down
    -      val (pushDown, stayUp) = 
splitConjunctivePredicates(condition).span(_.deterministic)
    +      val (pushDown, stayUp) = 
splitConjunctivePredicates(condition).partition(_.deterministic)
    --- End diff --
    
    @viirya 
    IIUC, with `span`, the deterministic predicates after the first 
non-deterministic will not be pushed down, but with `partition`, all 
deterministic predicates will be pushed down.


---

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

Reply via email to