Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1399#discussion_r15154735
  
    --- Diff: bin/spark-sql ---
    @@ -0,0 +1,81 @@
    +#!/usr/bin/env bash
    +
    +#
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#    http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +#
    +
    +SCALA_VERSION=2.10
    +
    +cygwin=false
    +case "`uname`" in
    +    CYGWIN*) cygwin=true;;
    +esac
    +
    +# Enter posix mode for bash
    +set -o posix
    +
    +# Figure out where Spark is installed
    +FWDIR="$(cd `dirname $0`/..; pwd)"
    +
    +if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
    +  echo "Usage: ./sbin/spark-sql [options]"
    +  $FWDIR/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
    +  exit 0
    +fi
    +
    +ASSEMBLY_DIR="$FWDIR/assembly/target/scala-$SCALA_VERSION"
    --- End diff --
    
    There is a lot of code here devoted to finding the assembly jar, checking 
java, etc. I think this is all redundant with code that already gets triggered 
when `spark-submit` is called, ideally we won't have this in multiple places.
    
    The `spark-submit` script used to allow you to set the jar name to be 
`spark-internal` in which case it wouldn't require you to pass in a jar (since 
the Spark assembly is already added automatically). I didn't realize, but that 
was removed in 
https://github.com/apache/spark/commit/4b8ec6fc#diff-4d2ab44195558d5a9d5f15b8803ef39dL47
 and replaced with more specific versions for the shell. Anyways, it would be 
good to add back a generic `spark-internal` for other internal classes like 
this.
    
    Then this script can be very simple, it will just call `spark-submit` and 
then pass the class as 
`org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to