-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-15416][SQL]Display a better message for not finding classes removed in Spark 2.0 #13201
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
Conversation
|
Test build #58898 has finished for PR 13201 at commit
|
|
There are many space changes. Please use this link https://github.com/apache/spark/pull/13201/files?w=1 to review. |
|
Test build #58902 has finished for PR 13201 at commit
|
| // NoClassDefFoundError's class name uses "/" rather than "." for packages | ||
| val className = e.getMessage.replaceAll("/", ".") | ||
| if (spark2RemovedClasses.contains(className)) { | ||
| throw new ClassNotFoundException(s"$className is removed in Spark 2.0. " + |
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.
nit is -> was
|
Test build #58917 has finished for PR 13201 at commit
|
|
Thanks! Merging to master and 2.0 |
…emoved in Spark 2.0
## What changes were proposed in this pull request?
If finding `NoClassDefFoundError` or `ClassNotFoundException`, check if the class name is removed in Spark 2.0. If so, the user must be using an incompatible library and we can provide a better message.
## How was this patch tested?
1. Run `bin/pyspark --packages com.databricks:spark-avro_2.10:2.0.1`
2. type `sqlContext.read.format("com.databricks.spark.avro").load("src/test/resources/episodes.avro")`.
It will show `java.lang.ClassNotFoundException: org.apache.spark.sql.sources.HadoopFsRelationProvider is removed in Spark 2.0. Please check if your library is compatible with Spark 2.0`
Author: Shixiong Zhu <[email protected]>
Closes #13201 from zsxwing/better-message.
(cherry picked from commit 16ba71a)
Signed-off-by: Michael Armbrust <[email protected]>
What changes were proposed in this pull request?
If finding
NoClassDefFoundErrororClassNotFoundException, check if the class name is removed in Spark 2.0. If so, the user must be using an incompatible library and we can provide a better message.How was this patch tested?
bin/pyspark --packages com.databricks:spark-avro_2.10:2.0.1sqlContext.read.format("com.databricks.spark.avro").load("src/test/resources/episodes.avro").It will show
java.lang.ClassNotFoundException: org.apache.spark.sql.sources.HadoopFsRelationProvider is removed in Spark 2.0. Please check if your library is compatible with Spark 2.0