From d09297722199e3c108c527a247df0d000694f68d Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Tue, 18 Jul 2023 12:39:04 +0900 Subject: [PATCH] avoid double slashes --- core/src/main/scala/org/apache/spark/util/Utils.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index eafb44436620..048c6ebfa748 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -442,7 +442,7 @@ private[spark] object Utils extends Logging with SparkClassUtils { // `file` and `localhost` are not used. Just to prevent URI from parsing `fileName` as // scheme or host. The prefix "/" is required because URI doesn't accept a relative path. // We should remove it after we get the raw path. - encodeRelativeUnixPathToURIRawPath(fileName).substring(1) + encodeRelativeUnixPathToURIRawPath(fileName) } /** @@ -453,7 +453,7 @@ private[spark] object Utils extends Logging with SparkClassUtils { // `file` and `localhost` are not used. Just to prevent URI from parsing `fileName` as // scheme or host. The prefix "/" is required because URI doesn't accept a relative path. // We should remove it after we get the raw path. - new URI("file", null, "localhost", -1, "/" + path, null, null).getRawPath + new URI("file", null, "localhost", -1, "/" + path, null, null).getRawPath.substring(1) } /**