wangyum commented on a change in pull request #25869: [SPARK-29189][SQL] Add an 
option to ignore block locations when listing file
URL: https://github.com/apache/spark/pull/25869#discussion_r327405778
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala
 ##########
 @@ -426,25 +426,26 @@ class FileIndexSuite extends SharedSparkSession {
       }
       val path = new Path(dir.getCanonicalPath)
 
-      var withBlockLocations, withoutBlockLocations = Seq.empty[FileStatus]
       withSQLConf(SQLConf.IGNORE_DATA_LOCALITY.key -> "false",
          "fs.file.impl" -> classOf[SpecialBlockLocationFileSystem].getName) {
         val fileIndex = new InMemoryFileIndex(spark, Seq(path), Map.empty, 
None)
-        withBlockLocations = fileIndex.
-          listLeafFiles(Seq(new Path(partitionDirectory.getPath))).toSeq
-      }
-      withSQLConf(SQLConf.IGNORE_DATA_LOCALITY.key -> "true",
-         "fs.file.impl" -> classOf[SpecialBlockLocationFileSystem].getName) {
-        val fileIndex = new InMemoryFileIndex(spark, Seq(path), Map.empty, 
None)
-        withoutBlockLocations = fileIndex.
-          listLeafFiles(Seq(new Path(partitionDirectory.getPath))).toSeq
+        val withBlockLocations = fileIndex.
+          listLeafFiles(Seq(new Path(partitionDirectory.getPath)))
+
+        withSQLConf(SQLConf.IGNORE_DATA_LOCALITY.key -> "true",
+                     "fs.file.impl" -> 
classOf[SpecialBlockLocationFileSystem].getName) {
 
 Review comment:
   nit: indentation issue.

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


With regards,
Apache Git Services

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

Reply via email to