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

    https://github.com/apache/spark/pull/11745#discussion_r56743788
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -306,14 +311,28 @@ object SetOperationPushDown extends Rule[LogicalPlan] 
with PredicateHelper {
     }
     
     /**
    - * Attempts to eliminate the reading of unneeded columns from the query 
plan using the following
    - * transformations:
    + * Attempts to eliminate the reading of unneeded columns from the query 
plan
    + * by pushing Project through Filter.
      *
    - *  - Inserting Projections beneath the following operators:
    - *   - Aggregate
    - *   - Generate
    - *   - Project <- Join
    - *   - LeftSemiJoin
    + * Note: This rule could reverse the effects of 
PushPredicateThroughProject.
    + * This rule should be run before ColumnPruning for ensuring that Project 
can be
    + * pushed as low as possible.
    + */
    +object PushProjectThroughFilter extends Rule[LogicalPlan] {
    --- End diff --
    
    @davies 
    
    The naming of this rule is not right, but I still think this PR fixes the 
fundamental issue between the conflicts of `ColumnPruning` and 
`PushPredicateThroughProject`. If we do not take the ideas of this PR, I can 
find a test case to show the minor fix in `ColumnPruning` does not cover all 
the cases. 


---
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