Skip to content

Commit c986e93

Browse files
falakirxin
authored andcommitted
[SPARK-10711] [SPARKR] Do not assume spark.submit.deployMode is always 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 <hossein@databricks.com> Closes #8832 from falaki/SPARK-10711.
1 parent 0494c80 commit c986e93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/api/r/RUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private[spark] object RUtils {
4444
(sys.props("spark.master"), sys.props("spark.submit.deployMode"))
4545
} else {
4646
val sparkConf = SparkEnv.get.conf
47-
(sparkConf.get("spark.master"), sparkConf.get("spark.submit.deployMode"))
47+
(sparkConf.get("spark.master"), sparkConf.get("spark.submit.deployMode", "client"))
4848
}
4949

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

0 commit comments

Comments
 (0)