dongjoon-hyun commented on code in PR #55579:
URL: https://github.com/apache/spark/pull/55579#discussion_r3220495968
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileScan.scala:
##########
@@ -186,6 +188,21 @@ trait FileScan extends Scan
partitions.toArray
}
+ /**
+ * SPARK-30628: produce InputPartitions taking additional runtime filters
into account.
+ * Called by `BatchScanExec.filteredPartitions` with DPP and scalar-subquery
filters that
+ * must apply on top of the scan's compile-time `partitionFilters`. Returns
the same
+ * partitions as `planInputPartitions()` when `extraFilters` is empty.
+ */
+ def planInputPartitionsWithRuntimeFilters(
+ extraFilters: Seq[Expression]): Array[InputPartition] = {
+ if (extraFilters.isEmpty) {
+ planInputPartitions()
+ } else {
+ partitionsImpl(partitionFilters ++ extraFilters).toArray
Review Comment:
What happens for the existing 3rd-party DSv2 data sources which overrides
`FileScan.partitions` already?
Could you add an explicit comment that we need to override `partitionsImpl`
for runtime-filter path?
--
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]