[ 
https://issues.apache.org/jira/browse/SPARK-15360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15287117#comment-15287117
 ] 

Miao Wang commented on SPARK-15360:
-----------------------------------

In Spark 1.6.1, spark-submit uses SparkSubmitArguments.scala and it prints out 
usage when no argument is provided.

In Spark 2.0.0, spark-submit uses SpakSubmitCommandBuilder.java,

  List<String> buildSparkSubmitArgs() {
    List<String> args = new ArrayList<>();
    SparkSubmitOptionParser parser = new SparkSubmitOptionParser();

    if (!allowsMixedArguments) {
      checkArgument(appResource != null, "Missing application resource.");
    }

checkArgument throws an exception when there is no argument provided.

Now, I am comparing the two files and try to add the logic in scala to the java 
function.

> Should print spark-submit usage when no arguments is specified
> --------------------------------------------------------------
>
>                 Key: SPARK-15360
>                 URL: https://issues.apache.org/jira/browse/SPARK-15360
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Submit
>    Affects Versions: 2.0.0
>            Reporter: Jeff Zhang
>            Priority: Minor
>
> In spark 1.6.1, it would print spark-submit usage when calling 
> bin/spark-submit without any argument, but in spark 2.0, it would just print 
> error, it would be nice to make it consistent with spark 1.6.1
> {noformat}
> Exception in thread "main" java.lang.IllegalArgumentException: Missing 
> application resource.
>       at 
> org.apache.spark.launcher.CommandBuilderUtils.checkArgument(CommandBuilderUtils.java:241)
>       at 
> org.apache.spark.launcher.SparkSubmitCommandBuilder.buildSparkSubmitArgs(SparkSubmitCommandBuilder.java:151)
>       at 
> org.apache.spark.launcher.SparkSubmitCommandBuilder.buildSparkSubmitCommand(SparkSubmitCommandBuilder.java:267)
>       at 
> org.apache.spark.launcher.SparkSubmitCommandBuilder.buildCommand(SparkSubmitCommandBuilder.java:142)
>       at org.apache.spark.launcher.Main.main(Main.java:86)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to