cchighman commented on a change in pull request #28841:
URL: https://github.com/apache/spark/pull/28841#discussion_r440893695



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InMemoryFileIndex.scala
##########
@@ -356,26 +380,35 @@ object InMemoryFileIndex extends Logging {
           bulkListLeafFiles(
             dirs.map(_.getPath),
             hadoopConf,
-            filter,
+            filters,
             session,
-            areRootPaths = false
+            areRootPaths = false,
+            parameters = parameters
           ).flatMap(_._2)
         case _ =>
           dirs.flatMap { dir =>
             listLeafFiles(
               dir.getPath,
               hadoopConf,
-              filter,
+              filters,
               sessionOpt,
               ignoreMissingFiles = ignoreMissingFiles,
               ignoreLocality = ignoreLocality,
-              isRootPath = false)
+              isRootPath = false,
+              parameters = parameters)
           }
       }
+      val fileFilters = (filters ++ FileModifiedDateOption.accept(
+        parameters,
+        sessionOpt.get,
+        hadoopConf))
+          .filter(filter => filter !=null)
+
       val allFiles = topLevelFiles ++ nestedFiles
-      if (filter != null) allFiles.filter(f => filter.accept(f.getPath)) else 
allFiles

Review comment:
       Once we added the ability to use classes extending from PathFilter, I 
realized we would only allow one filter to be applied at anytime.  Given the 
number of consumers calling InMemoryFileIndex methods, this seemed unideal, so 
I extended this to use a parallel array supporting multiple filters.  




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



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

Reply via email to