Skip to content

Conversation

@zsxwing
Copy link
Member

@zsxwing zsxwing commented May 19, 2016

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

@SparkQA
Copy link

SparkQA commented May 19, 2016

Test build #58898 has finished for PR 13201 at commit f92ce1f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • class IncompatibilityException(CapturedException):

@zsxwing zsxwing changed the title [SPARK-15416][PySpark]Display a better message for not finding classes removed in Spark 2.0 [SPARK-15416][SQL]Display a better message for not finding classes removed in Spark 2.0 May 19, 2016
@zsxwing
Copy link
Member Author

zsxwing commented May 19, 2016

There are many space changes. Please use this link https://github.com/apache/spark/pull/13201/files?w=1 to review.

@SparkQA
Copy link

SparkQA commented May 19, 2016

Test build #58902 has finished for PR 13201 at commit b99fac8.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@zsxwing
Copy link
Member Author

zsxwing commented May 19, 2016

cc @marmbrus @yhuai

// 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. " +
Copy link
Contributor

Choose a reason for hiding this comment

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

nit is -> was

@SparkQA
Copy link

SparkQA commented May 20, 2016

Test build #58917 has finished for PR 13201 at commit 0db5d20.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@marmbrus
Copy link
Contributor

Thanks! Merging to master and 2.0

asfgit pushed a commit that referenced this pull request May 20, 2016
…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]>
@asfgit asfgit closed this in 16ba71a May 20, 2016
@zsxwing zsxwing deleted the better-message branch May 20, 2016 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants