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

    https://github.com/apache/spark/pull/799#discussion_r12727045
  
    --- Diff: bin/pyspark ---
    @@ -51,14 +57,20 @@ export 
PYTHONPATH=$SPARK_HOME/python/lib/py4j-0.8.1-src.zip:$PYTHONPATH
     # Load the PySpark shell.py script when ./pyspark is used interactively:
     export OLD_PYTHONSTARTUP=$PYTHONSTARTUP
     export PYTHONSTARTUP=$FWDIR/python/pyspark/shell.py
    +export PYSPARK_SUBMIT_ARGS="$@"
     
     if [ -n "$IPYTHON_OPTS" ]; then
       IPYTHON=1
     fi
     
    -# Only use ipython if no command line arguments were provided [SPARK-1134]
    -if [[ "$IPYTHON" = "1" && $# = 0 ]] ; then
    -  exec ipython $IPYTHON_OPTS
    +# If a python file is provided, directly run spark-submit
    +if [[ "$1" =~ \.py$ ]]; then
    +  exec $FWDIR/bin/spark-submit $PYSPARK_SUBMIT_ARGS
    --- End diff --
    
    This won't work with quoted arguments. The problem is that when you convert 
`$@` to a variable the type changes to a string from an array. Check out the 
way `ORIG_ARGS` is handled inside of `spark-submit`.


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