cloud-fan commented on a change in pull request #34575:
URL: https://github.com/apache/spark/pull/34575#discussion_r772193740



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala
##########
@@ -355,7 +362,15 @@ case class FileSourceScanExec(
   @transient
   private lazy val pushedDownFilters = {
     val supportNestedPredicatePushdown = 
DataSourceUtils.supportNestedPredicatePushdown(relation)
-    dataFilters.flatMap(DataSourceStrategy.translateFilter(_, 
supportNestedPredicatePushdown))
+    // TODO: should be able to push filters containing metadata columns down 
to skip files
+    dataFilters
+      .filterNot(
+        _.references.exists {
+          case MetadataAttribute(_) => true
+          case _ => false
+        }
+      )
+      .flatMap(DataSourceStrategy.translateFilter(_, 
supportNestedPredicatePushdown))

Review comment:
       ```suggestion
       dataFilters.filterNot(_.references.exists {
         case MetadataAttribute(_) => true
         case _ => false
       }).flatMap(DataSourceStrategy.translateFilter(_, 
supportNestedPredicatePushdown))
   ```




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

Reply via email to