zml1206 commented on code in PR #44460:
URL: https://github.com/apache/spark/pull/44460#discussion_r1435915034


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1713,8 +1713,7 @@ object PushPredicateThroughNonJoin extends 
Rule[LogicalPlan] with PredicateHelpe
       project.copy(child = Filter(replaceAlias(condition, aliasMap), 
grandChild))
 
     case filter @ Filter(condition, aggregate: Aggregate)
-      if aggregate.aggregateExpressions.forall(_.deterministic)

Review Comment:
   I investigated before, 
   Similar ones are https://issues.apache.org/jira/browse/SPARK-20246. 
   At that time, it was because it was impossible to determine whether the 
filter expression was deterministic for example `$"rand" > 5`, therefore, it 
will incorrectly push down `$"rand" > 5`. 
   However, after the filter expression is replaced, it can be judged whether 
it is a deterministic expression.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to