Skip to content
Snippets Groups Projects
Commit c0052d8d authored by Jeff Zhang's avatar Jeff Zhang Committed by Marcelo Vanzin
Browse files

[SPARK-10481] [YARN] SPARK_PREPEND_CLASSES make spark-yarn related jar could n…

Throw a more readable exception. Please help review. Thanks

Author: Jeff Zhang <zjffdu@apache.org>

Closes #8649 from zjffdu/SPARK-10481.
parent 2ddeb631
No related branches found
No related tags found
No related merge requests found
......@@ -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."))
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment