guykhazma commented on a change in pull request #27112: [SPARK-30428][SQL] File 
source V2: support partition pruning
URL: https://github.com/apache/spark/pull/27112#discussion_r364757217
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileScan.scala
 ##########
 @@ -71,7 +103,7 @@ abstract class FileScan(
   }
 
   protected def partitions: Seq[FilePartition] = {
-    val selectedPartitions = fileIndex.listFiles(Seq.empty, Seq.empty)
+    val selectedPartitions = fileIndex.listFiles(partitionFilters, Seq.empty)
 
 Review comment:
   @gengliangwang @cloud-fan continuing the discussion from above (the comment 
was on the wrong line).
   The `V2ScanRelationPushDown` rule will pushdown the `dataFilters` only to 
datasources which support pushdown by implementing the 
`SupportsPushDownFilters`.
   Datasources such as `csv` and `json` do not implement the 
`SupportsPushDownFilters` trait. In order to support data skipping uniformly 
for all file based data sources, we override the `listFiles` method in a 
FileIndex implementation, which consults external metadata and prunes the list 
of files.
   The suggestion is to make the necessary changes to have the `dataFilters` 
passed to the `listFiles` as well.
   Otherwise, one would have to create a new datasource implementation in order 
to support each file based datasource that doesn't have a built in pushdown 
mechanism.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to