dongjoon-hyun commented on code in PR #55579:
URL: https://github.com/apache/spark/pull/55579#discussion_r3220519836
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/BatchScanExec.scala:
##########
@@ -63,10 +63,19 @@ case class BatchScanExec(
@transient private[sql] lazy val filteredPartitions:
Seq[Option[InputPartition]] = {
val originalPartitioning = outputPartitioning
- val filtered = PushDownUtils.pushRuntimeFilters(scan, runtimeFilters,
table, output)
+ // SPARK-30628: V2 file scans don't implement SupportsRuntimeV2Filtering,
so route
+ // runtime filters through FileScan.planInputPartitionsWithRuntimeFilters
as Catalyst
+ // expressions. This preserves DynamicPruningExpression and
scalar-subquery semantics
+ // that V2-Predicate translation would drop.
+ val (filtered, newPartitions) = scan match {
+ case fs: FileScan if runtimeFilters.nonEmpty =>
Review Comment:
For the following, do you think we can add a guard explicitly?
> SPARK-30628: V2 file scans don't implement SupportsRuntimeV2Filtering
```scala
- case fs: FileScan if runtimeFilters.nonEmpty =>
+ case fs: FileScan if runtimeFilters.nonEmpty &&
!fs.isInstanceOf[SupportsRuntimeV2Filtering] =>
```
--
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]