HyukjinKwon commented on a change in pull request #24668: 
[SPARK-27676][SQL][SS] InMemoryFileIndex should respect 
spark.sql.files.ignoreMissingFiles
URL: https://github.com/apache/spark/pull/24668#discussion_r286287344
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala
 ##########
 @@ -178,6 +178,41 @@ class FileIndexSuite extends SharedSQLContext {
     }
   }
 
+  test("SPARK-27676: InMemoryFileIndex respects ignoreMissingFiles config for 
non-root paths") {
+    def doTest(): Unit = {
+      def makeCatalog(): InMemoryFileIndex = new InMemoryFileIndex(
+        spark, Seq(DeletionRaceFileSystem.rootFolderPath), Map.empty, None)
+
+      withSQLConf(SQLConf.IGNORE_MISSING_FILES.key -> "false") {
+        intercept[FileNotFoundException] {
+          makeCatalog()
+        }
+      }
+
+      withSQLConf(SQLConf.IGNORE_MISSING_FILES.key -> "true") {
+        val catalog = makeCatalog()
+        // doesn't throw an exception
+        assert(catalog.listLeafFiles(catalog.rootPaths).isEmpty)
+      }
+    }
+
+    withClue("test missing subdirectories") {
+      withSQLConf(
+          "fs.mockFs.impl" -> 
classOf[SubdirectoryDeletionRaceFileSystem].getName,
 
 Review comment:
   (there;s indentation nit here)

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to