Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18269#discussion_r121286974
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InMemoryFileIndex.scala
 ---
    @@ -248,60 +245,93 @@ object InMemoryFileIndex extends Logging {
        * @return all children of path that match the specified filter.
        */
       private def listLeafFiles(
    -      path: Path,
    +      paths: Seq[Path],
           hadoopConf: Configuration,
           filter: PathFilter,
    -      sessionOpt: Option[SparkSession]): Seq[FileStatus] = {
    -    logTrace(s"Listing $path")
    -    val fs = path.getFileSystem(hadoopConf)
    +      sessionOpt: Option[SparkSession]): Seq[(Path, Seq[FileStatus])] = {
    +    logTrace(s"Listing ${paths.mkString(", ")}")
     
         // [SPARK-17599] Prevent InMemoryFileIndex from failing if path 
doesn't exist
         // Note that statuses only include FileStatus for the files and dirs 
directly under path,
         // and does not include anything else recursively.
    -    val statuses = try fs.listStatus(path) catch {
    -      case _: FileNotFoundException =>
    -        logWarning(s"The directory $path was not found. Was it deleted 
very recently?")
    -        Array.empty[FileStatus]
    +    val statuses = paths.flatMap { path =>
    +      try {
    +        val fs = path.getFileSystem(hadoopConf)
    --- End diff --
    
    Yes, it's the same instance and should be reused


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to