Skip to content
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

[SPARK-44816][CONNECT] Improve error message when UDF class is not found #42500

Closed
wants to merge 1 commit into from
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
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,11 @@ class SparkConnectPlanner(val sessionHolder: SessionHolder) extends Logging {
s"Failed to load class correctly due to $nsm. " +
"Make sure the artifact where the class is defined is installed by calling" +
" session.addArtifact.")
case cnf: ClassNotFoundException =>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is great!

One thing to think about: If there is no serialization proxy involved it should be relatively easy to figure out which class to add. However if a proxy involved you'll get a ClassCastException that is very cryptic. See
https://issues.apache.org/jira/browse/SPARK-36917. We could also try to make that a bit more actionable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't reproduce this in the context of connect. Can you help with getting a repro of this issue in connect, and I'll be happy to look into this?

throw new ClassNotFoundException(
s"Failed to load class: ${cnf.getMessage}. " +
"Make sure the artifact where the class is defined is installed by calling" +
" session.addArtifact.")
case _ => throw t
}
}
Expand Down