File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,23 @@ export SPARK_HOME="$FWDIR"
2525
2626source " $FWDIR /bin/utils.sh"
2727
28- SPARK_SCALA_VERSION=2.10
28+ if [ -z " $SPARK_SCALA_VERSION " ]; then
29+
30+ ASSEMBLY_DIR2=" $FWDIR /assembly/target/scala-2.11"
31+ ASSEMBLY_DIR1=" $FWDIR /assembly/target/scala-2.10"
32+
33+ if [[ -d " $ASSEMBLY_DIR2 " && -d " $ASSEMBLY_DIR1 " ]]; then
34+ echo -e " Presence of build for both scala versions(SCALA 2.10 and SCALA 2.11) detected." 1>&2
35+ echo -e ' Either clean one of them or, export SPARK_SCALA_VERSION=2.11 in spark-env.sh.' 1>&2
36+ exit 1
37+ fi
38+
39+ if [ -d " $ASSEMBLY_DIR2 " ]; then
40+ SPARK_SCALA_VERSION=" 2.11"
41+ else
42+ SPARK_SCALA_VERSION=" 2.10"
43+ fi
44+ fi
2945
3046function usage() {
3147 echo " Usage: ./bin/pyspark [options]" 1>&2
You can’t perform that action at this time.
0 commit comments