Skip to content

Commit

Permalink
[SPARK-10481] [YARN] SPARK_PREPEND_CLASSES make spark-yarn related ja…
Browse files Browse the repository at this point in the history
…r could n…

Throw a more readable exception. Please help review. Thanks

Author: Jeff Zhang <zjffdu@apache.org>

Closes #8649 from zjffdu/SPARK-10481.
  • Loading branch information
zjffdu authored and Marcelo Vanzin committed Sep 9, 2015
1 parent 2ddeb63 commit c0052d8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,10 @@ object Client extends Logging {
s"in favor of the $CONF_SPARK_JAR configuration variable.")
System.getenv(ENV_SPARK_JAR)
} else {
SparkContext.jarOfClass(this.getClass).head
SparkContext.jarOfClass(this.getClass).getOrElse(throw new SparkException("Could not "
+ "find jar containing Spark classes. The jar can be defined using the "
+ "spark.yarn.jar configuration option. If testing Spark, either set that option or "
+ "make sure SPARK_PREPEND_CLASSES is not set."))
}
}

Expand Down

0 comments on commit c0052d8

Please sign in to comment.