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-48688][SQL] Return reasonable error when calling SQL to_avro and from_avro functions but Avro is not loaded by default #47063

Closed

Conversation

dtenedor
Copy link
Contributor

What changes were proposed in this pull request?

This PR updates the new to_avro and from_avro SQL functions added in #46977 to return reasonable errors when Avro is not loaded by default.

Why are the changes needed?

According to the Apache Spark Avro Data Source Guide, Avro is not loaded into Spark by default. With this change, users get reasonable error messages if they try to call the to_avro or from_avro SQL functions in this case with instructions telling them what to do, rather than obscure Java ClassNotFoundExceptions.

Does this PR introduce any user-facing change?

Yes, see above.

How was this patch tested?

This PR adds golden file based test coverage.

Was this patch authored or co-authored using generative AI tooling?

No GitHub copilot this time.

@github-actions github-actions bot added the SQL label Jun 21, 2024
@github-actions github-actions bot added the DOCS label Jun 22, 2024
@HyukjinKwon
Copy link
Member

Merged to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants