Github user cloud-fan commented on the pull request:
https://github.com/apache/spark/pull/11828#issuecomment-199646190
If my understanding is right, what we want is:
* insert a `Project` below `Filter`, so that we may have chance to push it
down further.
* push down `Filter` through `Project`, to reduce the number of input rows.
The problem is: at the time we push `Filter` through `Project`, we don't
know if this `Project` can be pushed down further, and we may mistakenly lift
it and make the plan sub-optimal.
I think logically we should put `ColumnPruning` and
`PushPredicatesThroughProject` in different batches, so that when we push down
`Filter` through `Project`, we can make sure this `Project` can't be pushed
further and it's safe to lift it.
Anyway, this PR does fix the problem, but I think we should simplify the
`Operator Optimizations` batch, it contains over 30 rules, and is very hard to
reason about how these rules interact with each other.
---
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]