Skip to content

[SPARK-48688][SQL] Return reasonable error when calling SQL to_avro and from_avro functions but Avro is not loaded by default#47063

Closed
dtenedor wants to merge 2 commits into
apache:masterfrom
dtenedor:to-from-avro-error-not-loaded
Closed

[SPARK-48688][SQL] Return reasonable error when calling SQL to_avro and from_avro functions but Avro is not loaded by default#47063
dtenedor wants to merge 2 commits into
apache:masterfrom
dtenedor:to-from-avro-error-not-loaded

Conversation

@dtenedor

Copy link
Copy Markdown
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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

2 participants