Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/1715#discussion_r15727018
--- Diff: bin/spark-sql ---
@@ -26,11 +26,16 @@ 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
+CLASS="org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
+
+if [[ "$@" = --help ]] || [[ "$@" = -h ]]; then
+ echo "Usage: ./sbin/spark-sql [options] [--] [CLI options]"
+ exec "$FWDIR"/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
--- End diff --
Actually if redirection is used, `exec` does return and the following code
gets executed
([reference](http://wiki.bash-hackers.org/commands/builtin/exec)). And during
my local test, it works as expected.
But indeed, I didn't notice this issue while adding this change. Should use
`exec` more carefully. Thanks!
---
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.
---