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

    https://github.com/apache/spark/pull/12774#discussion_r61534612
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/fileSourceInterfaces.scala
 ---
    @@ -376,14 +376,10 @@ class HDFSFileCatalog(
             HadoopFsRelation.shouldFilterOut(name)
           }
     
    -      val (dirs, files) = statuses.partition(_.isDirectory)
    +      val (_, files) = statuses.partition(_.isDirectory)
     
           // It uses [[LinkedHashSet]] since the order of files can affect the 
results. (SPARK-11500)
    -      if (dirs.isEmpty) {
    -        mutable.LinkedHashSet(files: _*)
    -      } else {
    -        mutable.LinkedHashSet(files: _*) ++ 
listLeafFiles(dirs.map(_.getPath))
    -      }
    +      mutable.LinkedHashSet(files: _*)
    --- End diff --
    
    Also, I believe there is another method in `HadoopFsRelation` companion 
object to list up files parallely. This will use this method based on a 
threshold. I think that should be also corrected if it is really problematic.


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