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

    https://github.com/apache/spark/pull/1886#discussion_r16071043
  
    --- Diff: bin/spark-sql ---
    @@ -43,52 +47,9 @@ function usage {
       $FWDIR/bin/spark-class $CLASS --help 2>&1 | grep -v "$pattern" 1>&2
     }
     
    -function ensure_arg_number {
    -  arg_number=$1
    -  at_least=$2
    -
    -  if [[ $arg_number -lt $at_least ]]; then
    -    usage
    -    exit 1
    -  fi
    -}
    -
    -if [[ "$@" = --help ]] || [[ "$@" = -h ]]; then
    +if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
       usage
       exit 0
     fi
     
    -CLI_ARGS=()
    -SUBMISSION_ARGS=()
    -
    -while (($#)); do
    -  case $1 in
    -    -d | --define | --database | -f | -h | --hiveconf | --hivevar | -i | 
-p)
    -      ensure_arg_number $# 2
    -      CLI_ARGS+=($1); shift
    -      CLI_ARGS+=($1); shift
    -      ;;
    -
    -    -e)
    -      ensure_arg_number $# 2
    -      CLI_ARGS+=($1); shift
    -      CLI_ARGS+=(\"$1\"); shift
    -      ;;
    -
    -    -s | --silent)
    -      CLI_ARGS+=($1); shift
    -      ;;
    -
    -    -v | --verbose)
    -      # Both SparkSubmit and SparkSQLCLIDriver recognizes -v | --verbose
    -      CLI_ARGS+=($1)
    -      SUBMISSION_ARGS+=($1); shift
    -      ;;
    -
    -    *)
    -      SUBMISSION_ARGS+=($1); shift
    -      ;;
    -  esac
    -done
    -
    -eval exec "$FWDIR"/bin/spark-submit --class $CLASS ${SUBMISSION_ARGS[*]} 
spark-internal ${CLI_ARGS[*]}
    +eval exec "$FWDIR"/bin/spark-submit --class $CLASS "${SUBMISSION_OPTS[@]}" 
spark-internal "${APPLICATION_OPTS[@]}"
    --- End diff --
    
    Actually the `eval` here has to be removed since we've already quoted 
things. You may try the following to verify:
    
    ```bash
    ./bin/spark-sql --name "a b"
    ```


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to