Skip to content

Commit

Permalink
[SPARK-10711] [SPARKR] Do not assume spark.submit.deployMode is alway…
Browse files Browse the repository at this point in the history
…s set

In ```RUtils.sparkRPackagePath()``` we
1. Call ``` sys.props("spark.submit.deployMode")``` which returns null if ```spark.submit.deployMode``` is not suet
2. Call ``` sparkConf.get("spark.submit.deployMode")``` which throws ```NoSuchElementException``` if ```spark.submit.deployMode``` is not set. This patch simply passes a default value ("cluster") for ```spark.submit.deployMode```.

cc rxin

Author: Hossein <[email protected]>

Closes apache#8832 from falaki/SPARK-10711.
  • Loading branch information
falaki authored and rxin committed Sep 22, 2015
1 parent 0494c80 commit c986e93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/api/r/RUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private[spark] object RUtils {
(sys.props("spark.master"), sys.props("spark.submit.deployMode"))
} else {
val sparkConf = SparkEnv.get.conf
(sparkConf.get("spark.master"), sparkConf.get("spark.submit.deployMode"))
(sparkConf.get("spark.master"), sparkConf.get("spark.submit.deployMode", "client"))
}

val isYarnCluster = master != null && master.contains("yarn") && deployMode == "cluster"
Expand Down

0 comments on commit c986e93

Please sign in to comment.