-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-49392][SQL] Catch errors when failing to write to external data source #47873
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
...re/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala
Outdated
Show resolved
Hide resolved
...re/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
Outdated
Show resolved
Hide resolved
...re/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala
Show resolved
Hide resolved
MaxGekk
left a comment
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.
The createRelation() method is called from 2 places at the moment. Shall we catch and provide similar errors at writeAndRead() (or in its caller).
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
Outdated
Show resolved
Hide resolved
...re/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala
Outdated
Show resolved
Hide resolved
uros-db
left a comment
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.
@MaxGekk thanks, ready for re-review now
sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala
Outdated
Show resolved
Hide resolved
|
+1, LGTM. Merging to master. |
What changes were proposed in this pull request?
Catch various exceptions thrown by the data source API, when failing to write to a data source, and rethrow
externalDataSourceExceptionto provide a more friendly error message for the user.Why are the changes needed?
To catch non-fatal exceptions when failing to save the results of a query into an external data source (for example:
com.crealytics.spark.excel).Does this PR introduce any user-facing change?
Yes, error messages when failing to write to an external data source should now be more user-friendly.
How was this patch tested?
New test in
ExplainSuite.Was this patch authored or co-authored using generative AI tooling?
No.