File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
yarn/src/main/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 1717
1818package org .apache .spark .deploy .yarn
1919
20+ import java .io .File
2021import java .net .{InetAddress , UnknownHostException , URI , URISyntaxException }
2122import java .nio .ByteBuffer
2223
@@ -752,8 +753,17 @@ object Client extends Logging {
752753 if (conf.contains(CONF_PYSPARK_ARCHIVES )) {
753754 conf.get(CONF_PYSPARK_ARCHIVES )
754755 } else {
755- val sparkJarPath = SparkContext .jarOfClass(this .getClass).head
756- sparkJarPath.substring(0 , sparkJarPath.lastIndexOf('/' )) + " /pyspark.zip"
756+ SparkContext .jarOfClass(this .getClass) match {
757+ case Some (jarPath) =>
758+ val path = new File (jarPath)
759+ val archives = new File (path.getParent + File .separator + " pyspark.zip" )
760+ if (archives.exists()) {
761+ archives.getAbsolutePath
762+ } else {
763+ " "
764+ }
765+ case None => " "
766+ }
757767 }
758768 }
759769
You can’t perform that action at this time.
0 commit comments