Skip to content

Commit 97a85d9

Browse files
authored
Update PartitioningAwareFileCatalog.scala
1 parent e168a63 commit 97a85d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningAwareFileCatalog.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ abstract class PartitioningAwareFileCatalog(
7777
// Make the path qualified (consistent with listLeafFiles and listLeafFilesInParallel).
7878
val fs = path.getFileSystem(hadoopConf)
7979
val qualifiedPathPre = fs.makeQualified(path)
80-
val qualifiedPath: Path = if (qualifiedPathPre.getParent == null) {
80+
val qualifiedPath: Path = if (qualifiedPathPre.isRoot && !qualifiedPathPre.isAbsolute) {
8181
// SPARK-17613: Always append `Path.SEPARATOR` to the end of parent directories,
82-
// because the `leafFile.getParent` would have returned a path with the separator at the
83-
// end.
82+
// because the `leafFile.getParent` would have returned an absolute path with the separator
83+
// at the end.
8484
new Path(qualifiedPathPre, Path.SEPARATOR)
8585
} else {
8686
qualifiedPathPre

0 commit comments

Comments
 (0)