diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala index 18a5366986113..790957f250440 100644 --- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala +++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala @@ -361,9 +361,9 @@ object SparkSubmit { val localURI = Utils.resolveURI(localPath) if (localURI.getScheme != "local") { args.files = mergeFileLists(args.files, localURI.toString) - (new Path(localPath)).getName + new Path(localPath).getName } else { - localURI.getPath.toString + localURI.getPath } }.mkString(File.pathSeparator) sysProps("spark.submit.pyArchives") = pyArchives diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 3bd70dc0f6af1..96e16c3cc201b 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -364,12 +364,13 @@ object PySparkAssembly { val src = new File(BuildCommons.sparkHome, "python/pyspark") val zipFile = new File(BuildCommons.sparkHome , "python/lib/pyspark.zip") - IO.delete(zipFile) + zipFile.delete() def entries(f: File):List[File] = f :: (if (f.isDirectory) IO.listFiles(f).toList.flatMap(entries(_)) else Nil) - IO.zip(entries(src).map( - d => (d, d.getAbsolutePath.substring(src.getParent.length +1))), - zipFile) + val sources = entries(src).map { d => + (d, d.getAbsolutePath.substring(src.getParent.length +1)) + } + IO.zip(sources, zipFile) val dst = new File(outDir, "pyspark") if (!dst.isDirectory()) {