-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-11125] [SQL] Uninformative exception when running spark-sql witho… #9134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -655,6 +655,15 @@ object SparkSubmit { | |
| // scalastyle:on println | ||
| } | ||
| System.exit(CLASS_NOT_FOUND_EXIT_STATUS) | ||
| case e: NoClassDefFoundError => | ||
| 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) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
There was a problem hiding this comment.
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").
NoClassDefFoundErroris lower-level problem; classes were compiled in the presence of some other classes that aren't available at runtime. It's "worse" thanClassNotFoundException. 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?