Allow to manually add extra JARs in the submitted job classpaths

This commit is contained in:
Alexandre Archambault 2016-09-21 11:01:22 +02:00
parent 974dee8cf4
commit 2807f64cb5
No known key found for this signature in database
GPG Key ID: 14640A6839C263A9
2 changed files with 11 additions and 2 deletions

View File

@ -229,6 +229,9 @@ case class SparkSubmitOptions(
@Short("main")
@Help("Main class to be launched (optional if in manifest)")
mainClass: String,
@Short("J")
@Help("Extra JARs to be added in the classpath of the job")
extraJars: List[String],
@Help("If master is yarn-cluster, write YARN app ID to a file. (The ID is deduced from the spark-submit output.)")
@Value("file")
yarnIdFile: String,

View File

@ -55,8 +55,14 @@ case class SparkSubmit(
options: SparkSubmitOptions
) extends App with ExtraArgsApp {
val helper = new Helper(options.common, remainingArgs)
val jars = helper.fetch(sources = false, javadoc = false)
val helper: Helper = new Helper(
options.common,
remainingArgs,
extraJars = options.extraJars.map(new File(_))
)
val jars =
helper.fetch(sources = false, javadoc = false) ++
options.extraJars.map(new File(_))
val (scalaVersion, sparkVersion) =
if (options.sparkVersion.isEmpty)