huaxingao commented on a change in pull request #33008:
URL: https://github.com/apache/spark/pull/33008#discussion_r659859205
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/V2ScanRelationPushDown.scala
##########
@@ -30,6 +30,35 @@ object V2ScanRelationPushDown extends Rule[LogicalPlan] {
import DataSourceV2Implicits._
override def apply(plan: LogicalPlan): LogicalPlan = plan transformDown {
+ case RowLevelOperation(operation, cond, relation: DataSourceV2Relation,
rewritePlan) =>
+ val mergeTable = relation.table.asMergeTable
+ val scanBuilder = mergeTable.newScanBuilder(relation.options)
+
+ val normalizedFilters = DataSourceStrategy.normalizeExprs(cond :: Nil,
relation.output)
+ val (_, normalizedFiltersWithoutSubquery) =
+ normalizedFilters.partition(SubqueryExpression.hasSubquery)
+
+ val (pushedFilters, remainingFilters) = PushDownUtils.pushFilters(
Review comment:
I am refactoring `V2ScanRelationPushDown` in this PR
https://github.com/apache/spark/pull/32049.
I have one more question for filter push down: in the doc of
`RowLevelOperation`.`scanBuilder()`, it is said that `Some sources will avoid
pushing filters into files (file granularity), while others will avoid pruning
files within a partition (partition granularity)`. To avoid pushing down the
filters that are mentioned above, do you need to change the current
implementation of filter push down?
--
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]