aboutsummaryrefslogtreecommitdiff
path: root/bin/beeline
diff options
context:
space:
mode:
Diffstat (limited to 'bin/beeline')
-rwxr-xr-xbin/beeline8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/beeline b/bin/beeline
index 3fcb6df343..1627626941 100755
--- a/bin/beeline
+++ b/bin/beeline
@@ -23,8 +23,10 @@
# Enter posix mode for bash
set -o posix
-# Figure out where Spark is installed
-FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
+# Figure out if SPARK_HOME is set
+if [ -z "${SPARK_HOME}" ]; then
+ export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
+fi
CLASS="org.apache.hive.beeline.BeeLine"
-exec "$FWDIR/bin/spark-class" $CLASS "$@"
+exec "${SPARK_HOME}/bin/spark-class" $CLASS "$@"