aboutsummaryrefslogtreecommitdiff
path: root/bin/spark-sql
diff options
context:
space:
mode:
Diffstat (limited to 'bin/spark-sql')
-rwxr-xr-xbin/spark-sql7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/spark-sql b/bin/spark-sql
index 4ea7bc6e39..970d12cbf5 100755
--- a/bin/spark-sql
+++ b/bin/spark-sql
@@ -17,6 +17,9 @@
# limitations under the License.
#
-export FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
+if [ -z "${SPARK_HOME}" ]; then
+ export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
+fi
+
export _SPARK_CMD_USAGE="Usage: ./bin/spark-sql [options] [cli option]"
-exec "$FWDIR"/bin/spark-submit --class org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver "$@"
+exec "${SPARK_HOME}"/bin/spark-submit --class org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver "$@"