Skip to content

Commit

Permalink
getCanonicalPath
Browse files Browse the repository at this point in the history
  • Loading branch information
pzzs committed Mar 12, 2015
1 parent 161cae3 commit e4a13fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1092,8 +1092,9 @@ 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:" + uri.getPath
case null | "local" => "file:" + file.getCanonicalPath
case _ => path
}

Expand Down

0 comments on commit e4a13fe

Please sign in to comment.