You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/22 01:59:33 UTC

[GitHub] [spark] JoshRosen commented on a change in pull request #24668: [SPARK-27676][SQL][SS] InMemoryFileIndex should respect spark.sql.files.ignoreMissingFiles

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

 ##########
 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:
   Ah, this was a little hard to see with IntelliJ showing parameter name hints. I'll fix.

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


With regards,
Apache Git Services

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