Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address a few comments (minor)
  • Loading branch information
andrewor14 committed May 16, 2014
commit b7ba0d86b350de91628f5d3d28796e4cb41f79d0
6 changes: 3 additions & 3 deletions bin/pyspark
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export SPARK_HOME="$FWDIR"

SCALA_VERSION=2.10

if [[ "$@" == *--help* ]]; then
if [[ "$@" = *--help ]] || [[ "$@" = *--h ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem to match -h for me... not sure if that was the intention of the second condition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe you want this to say

if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then

One thing is this will only detect if -h or --help is the _last_argument, but I think anything other than that is pretty tricky.

echo "Usage: ./bin/pyspark [options]"
./bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
exit 0
Expand Down Expand Up @@ -79,8 +79,8 @@ export PYSPARK_SUBMIT_ARGS

# If a python file is provided, directly run spark-submit.
if [[ "$1" =~ \.py$ ]]; then
echo -e "\nWARNING: Running python applications through ./bin/pyspark is deprecated as of Spark 1.0."
echo -e "Use ./bin/spark-submit <python file>\n"
echo -e "\nWARNING: Running python applications through ./bin/pyspark is deprecated as of Spark 1.0." 1>&2
echo -e "Use ./bin/spark-submit <python file>\n" 1>&2
exec $FWDIR/bin/spark-submit "$@"
else
# Only use ipython if no command line arguments were provided [SPARK-1134]
Expand Down
2 changes: 1 addition & 1 deletion bin/spark-shell
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ esac
# Enter posix mode for bash
set -o posix

if [[ "$@" == *--help* ]]; then
if [[ "$@" = *--help ]] || [[ "$@" = *--h ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the second condition for? It doesn't seem to match -h. I noticed if I run this with -h then I seem to just get the help option from spark-submit.

patrick@patrick-t430s:~/Documents/spark$ ./bin/spark-shell -h
Usage: spark-submit [options] <app jar | python file> [app options]
Options:

echo "Usage: ./bin/spark-shell [options]"
./bin/spark-submit --help 2>&1 | grep -v Usage 1>&2
exit 0
Expand Down