File tree Expand file tree Collapse file tree 4 files changed +32
-27
lines changed
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver Expand file tree Collapse file tree 4 files changed +32
-27
lines changed Original file line number Diff line number Diff line change 17
17
# limitations under the License.
18
18
#
19
19
20
- # Figure out where Spark is installed
21
- FWDIR="$(cd `dirname $0`/..; pwd)"
20
+ #
21
+ # Shell script for starting BeeLine
22
22
23
- # Find the java binary
24
- if [ -n "${JAVA_HOME}" ]; then
25
- RUNNER="${JAVA_HOME}/bin/java"
26
- else
27
- if [ `command -v java` ]; then
28
- RUNNER="java"
29
- else
30
- echo "JAVA_HOME is not set" >&2
31
- exit 1
32
- fi
33
- fi
23
+ # Enter posix mode for bash
24
+ set -o posix
34
25
35
- # Compute classpath using external script
36
- classpath_output=$($FWDIR/bin/compute-classpath.sh)
37
- if [[ "$?" != "0" ]]; then
38
- echo "$classpath_output"
39
- exit 1
40
- else
41
- CLASSPATH=$classpath_output
42
- fi
26
+ # Figure out where Spark is installed
27
+ FWDIR="$(cd `dirname $0`/..; pwd)"
43
28
44
29
CLASS="org.apache.hive.beeline.BeeLine"
45
- exec "$RUNNER" -cp "$CLASSPATH " $CLASS "$@"
30
+ exec "$FWDIR/bin/spark-class " $CLASS "$@"
Original file line number Diff line number Diff line change 23
23
# Enter posix mode for bash
24
24
set -o posix
25
25
26
+ CLASS="org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
27
+
26
28
# Figure out where Spark is installed
27
29
FWDIR="$(cd `dirname $0`/..; pwd)"
28
30
29
31
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
30
- echo "Usage: ./sbin/spark-sql [options]"
32
+ echo "Usage: ./sbin/spark-sql [options] [cli option]"
33
+ pattern="usage"
34
+ pattern+="\|Spark assembly has been built with Hive"
35
+ pattern+="\|NOTE: SPARK_PREPEND_CLASSES is set"
36
+ pattern+="\|Spark Command: "
37
+ pattern+="\|======="
38
+
31
39
$FWDIR/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
40
+ echo
41
+ echo "CLI options:"
42
+ $FWDIR/bin/spark-class $CLASS --help 2>&1 | grep -v "$pattern" 1>&2
32
43
exit 0
33
44
fi
34
45
35
- CLASS="org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
36
46
exec "$FWDIR"/bin/spark-submit --class $CLASS spark-internal $@
Original file line number Diff line number Diff line change @@ -26,11 +26,22 @@ set -o posix
26
26
# Figure out where Spark is installed
27
27
FWDIR="$(cd `dirname $0`/..; pwd)"
28
28
29
+ CLASS="org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
30
+
29
31
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
30
- echo "Usage: ./sbin/start-thriftserver [options]"
32
+ echo "Usage: ./sbin/start-thriftserver [options] [thrift server options]"
33
+ pattern="usage"
34
+ pattern+="\|Spark assembly has been built with Hive"
35
+ pattern+="\|NOTE: SPARK_PREPEND_CLASSES is set"
36
+ pattern+="\|Spark Command: "
37
+ pattern+="\|======="
38
+ pattern+="\|--help"
39
+
31
40
$FWDIR/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
41
+ echo
42
+ echo "Thrift server options:"
43
+ $FWDIR/bin/spark-class $CLASS --help 2>&1 | grep -v "$pattern" 1>&2
32
44
exit 0
33
45
fi
34
46
35
- CLASS="org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
36
47
exec "$FWDIR"/bin/spark-submit --class $CLASS spark-internal $@
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ private[hive] object HiveThriftServer2 extends Logging {
40
40
val optionsProcessor = new ServerOptionsProcessor("HiveThriftServer2")
41
41
42
42
if (!optionsProcessor.process(args)) {
43
- logWarning("Error starting HiveThriftServer2 with given arguments")
44
43
System.exit(-1)
45
44
}
46
45
You can’t perform that action at this time.
0 commit comments