Skip to content

Commit dced8eb

Browse files
committed
Update SparkContext.scala
1 parent e4a13fe commit dced8eb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,8 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
10921092
*/
10931093
def addFile(path: String, recursive: Boolean): Unit = {
10941094
val uri = new URI(path)
1095-
val file = new File(path)
10961095
val schemeCorrectedPath = uri.getScheme match {
1097-
case null | "local" => "file:" + file.getCanonicalPath
1096+
case null | "local" => "file:" + new File(path).getCanonicalPath
10981097
case _ => path
10991098
}
11001099

0 commit comments

Comments
 (0)