Skip to content

Commit 3269862

Browse files
committed
revise
1 parent daf5e33 commit 3269862

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/load-spark-env.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ if [ -z "${SPARK_HOME}" ]; then
2626
source "$(dirname "$0")"/find-spark-home
2727
fi
2828

29+
SPARK_ENV_SH="spark-env.sh"
2930
if [ -z "$SPARK_ENV_LOADED" ]; then
3031
export SPARK_ENV_LOADED=1
3132

3233
export SPARK_CONF_DIR="${SPARK_CONF_DIR:-"${SPARK_HOME}"/conf}"
3334

34-
if [ -f "${SPARK_CONF_DIR}/spark-env.sh" ]; then
35+
SPARK_ENV_SH="${SPARK_CONF_DIR}/${SPARK_ENV_SH}"
36+
if [[ -f "${SPARK_ENV_SH}" ]]; then
3537
# Promote all variable declarations to environment (exported) variables
3638
set -a
37-
. "${SPARK_CONF_DIR}/spark-env.sh"
39+
. ${SPARK_ENV_SH}
3840
set +a
3941
fi
4042
fi
@@ -49,7 +51,7 @@ if [ -z "$SPARK_SCALA_VERSION" ]; then
4951
ASSEMBLY_DIR_2="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_2}"
5052
if [[ -d "$ASSEMBLY_DIR_1" && -d "$ASSEMBLY_DIR_2" ]]; then
5153
echo "Presence of build for multiple Scala versions detected ($ASSEMBLY_DIR_1 and $ASSEMBLY_DIR_2)." 1>&2
52-
echo "Remove one of them or, export SPARK_SCALA_VERSION=$SCALA_VERSION_1 in ${SPARK_CONF_DIR}/spark-env.sh." 1>&2
54+
echo "Remove one of them or, export SPARK_SCALA_VERSION=$SCALA_VERSION_1 in ${SPARK_ENV_SH}." 1>&2
5355
exit 1
5456
fi
5557

0 commit comments

Comments
 (0)