File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ class FileIndexSuite extends SharedSQLContext {
182182 test(" refresh for InMemoryFileIndex with FileStatusCache" ) {
183183 withTempDir { dir =>
184184 val fileStatusCache = FileStatusCache .getOrCreate(spark)
185- val dirPath = new Path (dir.getCanonicalPath )
185+ val dirPath = new Path (dir.getAbsolutePath )
186186 val catalog = new InMemoryFileIndex (spark, Seq (dirPath), Map .empty,
187187 None , fileStatusCache) {
188188 def leafFilePaths : Seq [Path ] = leafFiles.keys.toSeq
@@ -197,11 +197,13 @@ class FileIndexSuite extends SharedSQLContext {
197197
198198 catalog.refresh()
199199
200- val path = new Path (file.getCanonicalPath)
201- assert(catalog.leafFilePaths.nonEmpty && catalog
202- .leafFilePaths.forall(p => p.toString.startsWith(" file:/" )))
203- assert(catalog.leafDirPaths.nonEmpty && catalog
204- .leafDirPaths.forall(p => p.toString.startsWith(" file:/" )))
200+ assert(catalog.leafFilePaths.size == 1 )
201+ assert(catalog.leafFilePaths.head.toString.stripSuffix(" /" ) ==
202+ s " file: ${file.getAbsolutePath.stripSuffix(" /" )}" )
203+
204+ assert(catalog.leafDirPaths.size == 1 )
205+ assert(catalog.leafDirPaths.head.toString.stripSuffix(" /" ) ==
206+ s " file: ${dir.getAbsolutePath.stripSuffix(" /" )}" )
205207 }
206208 }
207209}
You can’t perform that action at this time.
0 commit comments