guykhazma commented on a change in pull request #27157: [SPARK-30475][SQL] File 
source V2: Push data filters for file listing
URL: https://github.com/apache/spark/pull/27157#discussion_r365016129
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/FileScan.scala
 ##########
 @@ -65,6 +65,16 @@ trait FileScan extends Scan with Batch with 
SupportsReportStatistics with Loggin
    */
   def withPartitionFilters(partitionFilters: Seq[Expression]): FileScan
 
+  /**
+   * Returns the filters that can be use for file listing
+   */
+  def dataFilters: Seq[Expression]
 
 Review comment:
   @gengliangwang it's seem to me more straight forward to split the filters to 
`dataFilters` and `partitionFilters` within the `PruneFileSourcePartitions` 
rule as there is a need to resolve the partition columns from the relation in 
order to get the `partitionFilters` and `dataFilters`.
   
   Also from the point of view of the `FileScan` trait it seems cleaner to have 
as a metadata in the description distinction between the `dataFilters` and 
`partitionFilters`.
   
   One option is to have 
   ```
   def withFilters(partitionFilters: Seq[Expression], dataFilters: 
Seq[Expression]): FileScan
   ```
   instead of 2 functions one for the `dataFilters` and one for the 
`partitionFilters`.
   
   What do you think?

----------------------------------------------------------------
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