aboutsummaryrefslogtreecommitdiff
path: root/bin/beeline
diff options
context:
space:
mode:
authorCheng Lian <lian.cs.zju@gmail.com>2014-08-06 12:28:35 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-08-06 12:28:35 -0700
commita6cd31108f0d73ce6823daafe8447677e03cfd13 (patch)
treeb37ec4045b01db8d5f5635fe77e6b2a50d082830 /bin/beeline
parent48789117c2dd6d38e0bd8d21cdbcb989913205a6 (diff)
downloadspark-a6cd31108f0d73ce6823daafe8447677e03cfd13.tar.gz
spark-a6cd31108f0d73ce6823daafe8447677e03cfd13.tar.bz2
spark-a6cd31108f0d73ce6823daafe8447677e03cfd13.zip
[SPARK-2678][Core][SQL] A workaround for SPARK-2678
JIRA issues: - Main: [SPARK-2678](https://issues.apache.org/jira/browse/SPARK-2678) - Related: [SPARK-2874](https://issues.apache.org/jira/browse/SPARK-2874) Related PR: - #1715 This PR is both a fix for SPARK-2874 and a workaround for SPARK-2678. Fixing SPARK-2678 completely requires some API level changes that need further discussion, and we decided not to include it in Spark 1.1 release. As currently SPARK-2678 only affects Spark SQL scripts, this workaround is enough for Spark 1.1. Command line option handling logic in bash scripts looks somewhat dirty and duplicated, but it helps to provide a cleaner user interface as well as retain full downward compatibility for now. Author: Cheng Lian <lian.cs.zju@gmail.com> Closes #1801 from liancheng/spark-2874 and squashes the following commits: 8045d7a [Cheng Lian] Make sure test suites pass 8493a9e [Cheng Lian] Using eval to retain quoted arguments aed523f [Cheng Lian] Fixed typo in bin/spark-sql f12a0b1 [Cheng Lian] Worked arount SPARK-2678 daee105 [Cheng Lian] Fixed usage messages of all Spark SQL related scripts
Diffstat (limited to 'bin/beeline')
-rwxr-xr-xbin/beeline29
1 files changed, 7 insertions, 22 deletions
diff --git a/bin/beeline b/bin/beeline
index 09fe366c60..1bda4dba50 100755
--- a/bin/beeline
+++ b/bin/beeline
@@ -17,29 +17,14 @@
# limitations under the License.
#
-# Figure out where Spark is installed
-FWDIR="$(cd `dirname $0`/..; pwd)"
+#
+# Shell script for starting BeeLine
-# Find the java binary
-if [ -n "${JAVA_HOME}" ]; then
- RUNNER="${JAVA_HOME}/bin/java"
-else
- if [ `command -v java` ]; then
- RUNNER="java"
- else
- echo "JAVA_HOME is not set" >&2
- exit 1
- fi
-fi
+# Enter posix mode for bash
+set -o posix
-# Compute classpath using external script
-classpath_output=$($FWDIR/bin/compute-classpath.sh)
-if [[ "$?" != "0" ]]; then
- echo "$classpath_output"
- exit 1
-else
- CLASSPATH=$classpath_output
-fi
+# Figure out where Spark is installed
+FWDIR="$(cd `dirname $0`/..; pwd)"
CLASS="org.apache.hive.beeline.BeeLine"
-exec "$RUNNER" -cp "$CLASSPATH" $CLASS "$@"
+exec "$FWDIR/bin/spark-class" $CLASS "$@"