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 1717# limitations under the License.
1818#
1919
20- # Figure out where Spark is installed
21- FWDIR= " $( cd ` dirname $0 ` /.. ; pwd ) "
20+ #
21+ # Shell script for starting BeeLine
2222
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
3425
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) "
4328
4429CLASS=" 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 2323# Enter posix mode for bash
2424set -o posix
2525
26+ CLASS=" org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
27+
2628# Figure out where Spark is installed
2729FWDIR=" $( cd ` dirname $0 ` /..; pwd) "
2830
2931if [[ " $@ " = * --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+
3139 $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
3243 exit 0
3344fi
3445
35- CLASS=" org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
3646exec " $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
2626# Figure out where Spark is installed
2727FWDIR=" $( cd ` dirname $0 ` /..; pwd) "
2828
29+ CLASS=" org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
30+
2931if [[ " $@ " = * --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+
3140 $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
3244 exit 0
3345fi
3446
35- CLASS=" org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
3647exec " $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 {
4040 val optionsProcessor = new ServerOptionsProcessor (" HiveThriftServer2" )
4141
4242 if (! optionsProcessor.process(args)) {
43- logWarning(" Error starting HiveThriftServer2 with given arguments" )
4443 System .exit(- 1 )
4544 }
4645
You can’t perform that action at this time.
0 commit comments