gengliangwang commented on code in PR #38511:
URL: https://github.com/apache/spark/pull/38511#discussion_r1023241088
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala:
##########
@@ -146,8 +146,12 @@ object FileSourceStrategy extends Strategy with
PredicateHelper with Logging {
}
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
- case PhysicalOperation(projects, filters,
+ case ScanOperation(projects, allFilters,
l @ LogicalRelation(fsRelation: HadoopFsRelation, _, table, _)) =>
+ // We can only push down the bottom-most filter to the relation, as
`ScanOperation` decided to
+ // not merge these filters and we need to keep their evaluation order.
+ val filters = allFilters.lastOption.getOrElse(Nil)
Review Comment:
So for filter pushdown, we will use the last filter. For schema pruning, we
will use all the filters.
I wonder if we should return both `allFilters` and `pushdownFilters` to make
the syntax clear.
--
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]