From dced8ebee4832ee7c26167f08b412a49b84fbee9 Mon Sep 17 00:00:00 2001 From: DoingDone9 <799203320@qq.com> Date: Thu, 12 Mar 2015 17:34:50 +0800 Subject: [PATCH] Update SparkContext.scala --- core/src/main/scala/org/apache/spark/SparkContext.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 6b73d0b2f300a..004ab119f6133 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -1092,9 +1092,8 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli */ def addFile(path: String, recursive: Boolean): Unit = { val uri = new URI(path) - val file = new File(path) val schemeCorrectedPath = uri.getScheme match { - case null | "local" => "file:" + file.getCanonicalPath + case null | "local" => "file:" + new File(path).getCanonicalPath case _ => path }