diff options
author | Jeffrey Naisbitt <jnaisbitt@familysearch.org> | 2015-10-24 18:21:36 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-10-24 18:21:36 +0100 |
commit | 28132ceb10d0c127495ce8cb36135e1cb54164d7 (patch) | |
tree | 08de0c4d763afa42913d78234f462154df2c588e /bin/spark-class | |
parent | e5bc8c27577f96c1ae5dc8cf9bf41cbe2877ffe3 (diff) | |
download | spark-28132ceb10d0c127495ce8cb36135e1cb54164d7.tar.gz spark-28132ceb10d0c127495ce8cb36135e1cb54164d7.tar.bz2 spark-28132ceb10d0c127495ce8cb36135e1cb54164d7.zip |
[SPARK-11264] bin/spark-class can't find assembly jars with certain GREP_OPTIONS set
Temporarily remove GREP_OPTIONS if set in bin/spark-class.
Some GREP_OPTIONS will modify the output of the grep commands that are looking for the assembly jars.
For example, if the -n option is specified, the grep output will look like:
5:spark-assembly-1.5.1-hadoop2.4.0.jar
This will not match the regular expressions, and so the jar files will not be found. We could improve the regular expression to handle this case and trim off extra characters, but it is difficult to know which options may or may not be set. Unsetting GREP_OPTIONS within the script handles all the cases and gives the desired output.
Author: Jeffrey Naisbitt <jnaisbitt@familysearch.org>
Closes #9231 from naisbitt/unset-GREP_OPTIONS.
Diffstat (limited to 'bin/spark-class')
-rwxr-xr-x | bin/spark-class | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/bin/spark-class b/bin/spark-class index e38e08dec4..8cae6ccbab 100755 --- a/bin/spark-class +++ b/bin/spark-class @@ -42,6 +42,7 @@ else ASSEMBLY_DIR="$SPARK_HOME/assembly/target/scala-$SPARK_SCALA_VERSION" fi +GREP_OPTIONS= num_jars="$(ls -1 "$ASSEMBLY_DIR" | grep "^spark-assembly.*hadoop.*\.jar$" | wc -l)" if [ "$num_jars" -eq "0" -a -z "$SPARK_ASSEMBLY_JAR" -a "$SPARK_PREPEND_CLASSES" != "1" ]; then echo "Failed to find Spark assembly in $ASSEMBLY_DIR." 1>&2 |