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

    https://github.com/apache/spark/pull/17079#discussion_r103373620
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala
 ---
    @@ -178,6 +178,33 @@ class FileIndexSuite extends SharedSQLContext {
           assert(catalog2.allFiles().nonEmpty)
         }
       }
    +
    +  test("refresh for InMemoryFileIndex with FileStatusCache") {
    +    withTempDir { dir =>
    +      val fileStatusCache = FileStatusCache.getOrCreate(spark)
    +      val dirPath = new Path(dir.getAbsolutePath)
    +      val fs = dirPath.getFileSystem(spark.sessionState.newHadoopConf())
    +      val catalog =
    +        new InMemoryFileIndex(spark, Seq(dirPath), Map.empty, None, 
fileStatusCache) {
    +        def leafFilePaths: Seq[Path] = leafFiles.keys.toSeq
    +        def leafDirPaths: Seq[Path] = leafDirToChildrenFiles.keys.toSeq
    +      }
    +
    +      assert(catalog.leafDirPaths.isEmpty)
    +      assert(catalog.leafFilePaths.isEmpty)
    --- End diff --
    
    Move these two asserts after `stringToFile`


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to