Skip to content

Commit daf5e33

Browse files
committed
address comments
1 parent 1289df1 commit daf5e33

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

bin/load-spark-env.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ fi
4242
# Setting SPARK_SCALA_VERSION if not already set.
4343

4444
if [ -z "$SPARK_SCALA_VERSION" ]; then
45-
SCALA_VERSION1=2.12
46-
SCALA_VERSION2=2.11
47-
48-
ASSEMBLY_DIR1="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION1}"
49-
ASSEMBLY_DIR2="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION2}"
50-
if [[ -d "$ASSEMBLY_DIR1" && -d "$ASSEMBLY_DIR2" ]]; then
51-
echo -e "Presence of build for multiple Scala versions detected($ASSEMBLY_DIR1 and $ASSEMBLY_DIR2)." 1>&2
52-
echo -e "Remove one of them, or export SPARK_SCALA_VERSION=$SCALA_VERSION1 in load-spark-env.sh." 1>&2
45+
SCALA_VERSION_1=2.12
46+
SCALA_VERSION_2=2.11
47+
48+
ASSEMBLY_DIR_1="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_1}"
49+
ASSEMBLY_DIR_2="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_2}"
50+
if [[ -d "$ASSEMBLY_DIR_1" && -d "$ASSEMBLY_DIR_2" ]]; then
51+
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
5353
exit 1
5454
fi
5555

56-
if [ -d "$ASSEMBLY_DIR1" ]; then
57-
export SPARK_SCALA_VERSION=$SCALA_VERSION1
56+
if [[ -d "$ASSEMBLY_DIR_1" ]]; then
57+
export SPARK_SCALA_VERSION=${SCALA_VERSION_1}
5858
else
59-
export SPARK_SCALA_VERSION=$SCALA_VERSION2
59+
export SPARK_SCALA_VERSION=${SCALA_VERSION_2}
6060
fi
6161
fi

0 commit comments

Comments
 (0)