Skip to content

Commit

Permalink
Migrating version detection to PySpark
Browse files Browse the repository at this point in the history
  • Loading branch information
pwendell authored and ScrapCodes committed Nov 10, 2014
1 parent b1ed44d commit 2121071
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bin/pyspark
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,23 @@ export SPARK_HOME="$FWDIR"

source "$FWDIR/bin/utils.sh"

SPARK_SCALA_VERSION=2.10
if [ -z "$SPARK_SCALA_VERSION" ]; then

ASSEMBLY_DIR2="$FWDIR/assembly/target/scala-2.11"
ASSEMBLY_DIR1="$FWDIR/assembly/target/scala-2.10"

if [[ -d "$ASSEMBLY_DIR2" && -d "$ASSEMBLY_DIR1" ]]; then
echo -e "Presence of build for both scala versions(SCALA 2.10 and SCALA 2.11) detected." 1>&2
echo -e 'Either clean one of them or, export SPARK_SCALA_VERSION=2.11 in spark-env.sh.' 1>&2
exit 1
fi

if [ -d "$ASSEMBLY_DIR2" ]; then
SPARK_SCALA_VERSION="2.11"
else
SPARK_SCALA_VERSION="2.10"
fi
fi

function usage() {
echo "Usage: ./bin/pyspark [options]" 1>&2
Expand Down

0 comments on commit 2121071

Please sign in to comment.