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

    https://github.com/apache/spark/pull/7049#discussion_r33727646
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala ---
    @@ -379,31 +379,25 @@ abstract class HadoopFsRelation 
private[sql](maybePartitionSpec: Option[Partitio
         var leafDirToChildrenFiles = mutable.Map.empty[Path, Array[FileStatus]]
     
         def refresh(): Unit = {
    -      // We don't filter files/directories whose name start with "_" 
except "_temporary" here, as
    -      // specific data sources may take advantages over them (e.g. Parquet 
_metadata and
    -      // _common_metadata files). "_temporary" directories are explicitly 
ignored since failed
    -      // tasks/jobs may leave partial/corrupted data files there.
    -      def listLeafFilesAndDirs(fs: FileSystem, status: FileStatus): 
Set[FileStatus] = {
    -        if (status.getPath.getName.toLowerCase == "_temporary") {
    -          Set.empty
    -        } else {
    -          val (dirs, files) = 
fs.listStatus(status.getPath).partition(_.isDir)
    -          val leafDirs = if (dirs.isEmpty) Set(status) else 
Set.empty[FileStatus]
    -          files.toSet ++ leafDirs ++ dirs.flatMap(dir => 
listLeafFilesAndDirs(fs, dir))
    -        }
    -      }
     
           leafFiles.clear()
     
    -      val statuses = paths.flatMap { path =>
    +      val statuses = paths.par.flatMap { path =>
             val hdfsPath = new Path(path)
             val fs = hdfsPath.getFileSystem(hadoopConf)
             val qualified = hdfsPath.makeQualified(fs.getUri, 
fs.getWorkingDirectory)
    -        
Try(fs.getFileStatus(qualified)).toOption.toArray.flatMap(listLeafFilesAndDirs(fs,
 _))
    +        val it = fs.listFiles(qualified, true)
    --- End diff --
    
    Unfortunately this API doesn't exist in Hadoop 1...


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