Skip to content

Commit e4a13fe

Browse files
committed
getCanonicalPath
1 parent 161cae3 commit e4a13fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,9 @@ 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)
10951096
val schemeCorrectedPath = uri.getScheme match {
1096-
case null | "local" => "file:" + uri.getPath
1097+
case null | "local" => "file:" + file.getCanonicalPath
10971098
case _ => path
10981099
}
10991100

0 commit comments

Comments
 (0)