Skip to content

Commit 7e51538

Browse files
Lukas Rupprechttdas
authored andcommitted
Fixes wrong path concatenation in DeltaLog
Uses the recently introduced DeltaTableUtils.safeConcatPaths to fix path concatenation in Delta to be able to deal correctly with URIs with an empty path component. GitOrigin-RevId: 6c1955134439ebb67b133e502af4efc9073a6482
1 parent 04a29a4 commit 7e51538

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spark/src/main/scala/org/apache/spark/sql/delta/DeltaLog.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,9 @@ object DeltaLog extends DeltaLogging {
600600
/** The name of the subdirectory that holds Delta metadata files */
601601
private val LOG_DIR_NAME = "_delta_log"
602602

603-
private[delta] def logPathFor(dataPath: String): Path = new Path(dataPath, LOG_DIR_NAME)
604-
private[delta] def logPathFor(dataPath: Path): Path = new Path(dataPath, LOG_DIR_NAME)
603+
private[delta] def logPathFor(dataPath: String): Path = logPathFor(new Path(dataPath))
604+
private[delta] def logPathFor(dataPath: Path): Path =
605+
DeltaTableUtils.safeConcatPaths(dataPath, LOG_DIR_NAME)
605606
private[delta] def logPathFor(dataPath: File): Path = logPathFor(dataPath.getAbsolutePath)
606607

607608
/**

0 commit comments

Comments
 (0)