Skip to content

Commit

Permalink
fix submit job errors (apache#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandflee authored and foxish committed Jul 24, 2017
1 parent 42f578f commit 2c00103
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private[spark] object ClientArguments {
var otherPyFiles = Seq.empty[String]
var mainClass: Option[String] = None
val driverArgs = mutable.Buffer.empty[String]
args.sliding(2).toList.collect {
args.sliding(2, 2).toList.collect {
case Array("--primary-py-file", mainPyFile: String) =>
mainAppResource = Some(PythonMainAppResource(mainPyFile))
case Array("--primary-java-resource", primaryJavaResource: String) =>
Expand All @@ -54,7 +54,8 @@ private[spark] object ClientArguments {
case Array("--arg", arg: String) =>
driverArgs += arg
case other =>
throw new RuntimeException(s"Unknown arguments: $other")
val invalid = other.mkString(" ")
throw new RuntimeException(s"Unknown arguments: $invalid")
}
require(mainAppResource.isDefined,
"Main app resource must be defined by either --primary-py-file or --primary-java-resource.")
Expand Down

0 comments on commit 2c00103

Please sign in to comment.