Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,15 @@ object SparkSubmit {
// scalastyle:on println
}
System.exit(CLASS_NOT_FOUND_EXIT_STATUS)
case e: NoClassDefFoundError =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this OK. (PS the exception isn't "unreadable" -- just "uninformative"). NoClassDefFoundError is lower-level problem; classes were compiled in the presence of some other classes that aren't available at runtime. It's "worse" than ClassNotFoundException. It probably makes sense, but is this really a problem of building without Hive support? I would kind of think it's the opposite: you built with Hive and then it's not available at runtime?

e.printStackTrace(printStream)
if (e.getMessage.contains("org/apache/hadoop/hive")) {
// scalastyle:off println
printStream.println(s"Failed to load hive class.")
printStream.println("You need to build Spark with -Phive and -Phive-thriftserver.")
// scalastyle:on println
}
System.exit(CLASS_NOT_FOUND_EXIT_STATUS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to define another exit status to distinguish with the class not found exception?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect it is roughly the same to the caller. I would like to understand however how this happens?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue happens only when SPARK_PREPEND_CLASSES is true. In this case the spark assembly jar doesn't contain SparkSQLCLIDriver because spark is built without -Phive-thriftserver, but it can still be found in CLASSPATH because SPARK_PREPEND_CLASSES is true. But hive related class can not be found since it is not in the spark assembly jar.

}

// SPARK-4170
Expand Down