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

    https://github.com/apache/spark/pull/11635#discussion_r60440111
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -958,6 +958,26 @@ object PushDownPredicate extends Rule[LogicalPlan] 
with PredicateHelper {
     
           project.copy(child = Filter(replaceAlias(condition, aliasMap), 
grandChild))
     
    +    // Push [[Filter]] operators through [[Window]] operators. Parts of 
the predicate that can be
    +    // pushed beneath must satisfy three conditions:
    +    // 1. involving one and only one column that is part of window 
partitioning key.
    +    // 2. Window partitioning key should be just a sequence of 
[[AttributeReference]].
    --- End diff --
    
    @gatorsmile this restriction is probably more related to the fact that if 
we push down an entire expression, e.g.: `a + b`, we also need a place to 
evaluate the expression. Which would mean that we have to plan both a Project 
and a Filter.
    
    I am pretty sure that we move all expressions used in Window clauses into 
an underlying Project during Analysis. So this shouldn't be to big of a problem.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to