GitHub user HyukjinKwon opened a pull request:

    https://github.com/apache/spark/pull/18505

    [MINOR][SPARK SUBMIT] Print out R file usage in spark-submit

    ## What changes were proposed in this pull request?
    
    Currently, running the shell below:
    
    ```bash
    $ ./bin/spark-submit tmp.R a b c
    ```
    
    with R file, `tmp.R` as below:
    
    ```r
    #!/usr/bin/env Rscript
    
    library(SparkR)
    sparkRSQL.init(sparkR.init(master="local"))
    collect(createDataFrame(list(list(1))))
    print(commandArgs(trailingOnly=TRUE))
    ```
    
    working fine as below:
    
    ```bash
      _1
    1  1
    [1] "a" "b" "c"
    ```
    
    However, it looks not printed in usage documentation as below:
    
    ```bash
    $ ./bin/spark-submit
    ```
    
    ```
    Usage: spark-submit [options] <app jar | python file> [app arguments]
    ...
    ```
    
    For `./bin/sparkR`, it looks fine as below:
    
    ```bash
    $ ./bin/sparkR tmp.R
    ```
    
    ```
    Running R applications through 'sparkR' is not supported as of Spark 2.0.
    Use ./bin/spark-submit <R file>
    ```
    
    Running the script below:
    
    ```bash
    $ ./bin/spark-submit
    ```
    
    **Before**
    
    ```
    Usage: spark-submit [options] <app jar | python file> [app arguments]
    ...
    ```
    
    **After**
    
    ```
    Usage: spark-submit [options] <app jar | python file | R file> [app 
arguments]
    ...
    ```
    
    
    ## How was this patch tested?
    
    Manually tested.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HyukjinKwon/spark minor-doc-summit

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18505.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18505
    
----
commit 5b2b8c2eb7778c9866e0b72f4ddb54625b2e5ba8
Author: hyukjinkwon <[email protected]>
Date:   2017-07-03T01:32:05Z

    Print out R file usage in 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.
---

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

Reply via email to