Skip to content

Commit b7a9e93

Browse files
committed
move if condition
1 parent 7f958c1 commit b7a9e93

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/spark-submit

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ export SPARK_SUBMIT_PROPERTIES_FILE=${SPARK_SUBMIT_PROPERTIES_FILE:-"$DEFAULT_PR
6363
# paths, library paths, java options and memory early on. Otherwise, it will
6464
# be too late by the time the driver JVM has started.
6565

66-
if [[ "$SPARK_SUBMIT_DEPLOY_MODE" == "client" && -f "$SPARK_SUBMIT_PROPERTIES_FILE" ]]; then
67-
# Parse the properties file only if the special configs exist
68-
contains_special_configs=$(
69-
grep -e "spark.driver.extra*\|spark.driver.memory" "$SPARK_SUBMIT_PROPERTIES_FILE" | \
70-
grep -v "^[[:space:]]*#"
71-
)
66+
if [ "$SPARK_SUBMIT_DEPLOY_MODE" == "client" ]; then
67+
if [ -f "$SPARK_SUBMIT_PROPERTIES_FILE" ]; then
68+
# Parse the properties file only if the special configs exist
69+
contains_special_configs=$(
70+
grep -e "spark.driver.extra*\|spark.driver.memory" "$SPARK_SUBMIT_PROPERTIES_FILE" | \
71+
grep -v "^[[:space:]]*#"
72+
)
73+
fi
7274
if [[ -n "$contains_special_configs" || -n "$SPARK_SUBMIT_PACKAGES" ]]; then
7375
export SPARK_SUBMIT_BOOTSTRAP_DRIVER=1
7476
fi

0 commit comments

Comments
 (0)