Skip to content

Commit 2eea663

Browse files
pwendellaarondav
authored andcommitted
SPARK-1652: Set driver memory correctly in spark-submit.
The previous check didn't account for the fact that the default deploy mode is "client" unless otherwise specified. Also, this sets the more narrowly defined SPARK_DRIVER_MEMORY instead of setting SPARK_MEM. Author: Patrick Wendell <[email protected]> Closes #730 from pwendell/spark-submit and squashes the following commits: 430b98f [Patrick Wendell] Feedback from Aaron e788edf [Patrick Wendell] Changes based on Aaron's feedback f508146 [Patrick Wendell] SPARK-1652: Set driver memory correctly in spark-submit. (cherry picked from commit 05c9aa9) Signed-off-by: Aaron Davidson <[email protected]>
1 parent 5d69699 commit 2eea663

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/spark-submit

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ while (($#)); do
3535
shift
3636
done
3737

38-
if [ ! -z $DRIVER_MEMORY ] && [ ! -z $DEPLOY_MODE ] && [ $DEPLOY_MODE = "client" ]; then
39-
export SPARK_MEM=$DRIVER_MEMORY
38+
DEPLOY_MODE=${DEPLOY_MODE:-"client"}
39+
40+
if [ -n "$DRIVER_MEMORY" ] && [ $DEPLOY_MODE == "client" ]; then
41+
export SPARK_DRIVER_MEMORY=$DRIVER_MEMORY
4042
fi
4143

4244
$SPARK_HOME/bin/spark-class org.apache.spark.deploy.SparkSubmit "${ORIG_ARGS[@]}"

0 commit comments

Comments
 (0)