Skip to content

Commit 4b8a3ed

Browse files
committed
use pyArchivesEnvOpt
1 parent e6b573b commit 4b8a3ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ object SparkSubmit {
332332
// that can be distributed with the job
333333
if (args.isPython && clusterManager == YARN) {
334334
var pyArchives: String = null
335-
if (sys.env.contains("PYSPARK_ARCHIVES_PATH")) {
336-
pyArchives = sys.env.get("PYSPARK_ARCHIVES_PATH").get
335+
val pyArchivesEnvOpt = sys.env.get("PYSPARK_ARCHIVES_PATH")
336+
if (pyArchivesEnvOpt.isDefined) {
337+
pyArchives = pyArchivesEnvOpt.get
337338
} else {
338339
if (!sys.env.contains("SPARK_HOME")) {
339340
printErrorAndExit("SPARK_HOME does not exist for python application in yarn mode.")

0 commit comments

Comments
 (0)