forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-46524][SQL] Improve error messages for invalid save mode
### What changes were proposed in this pull request? This PR improves the error messages when writing a data frame with an invalid save mode. ### Why are the changes needed? To improve the error messages. Before this PR, Spark throws an java.lang.IllegalArgumentException: `java.lang.IllegalArgumentException: Unknown save mode: foo. Accepted save modes are 'overwrite', 'append', 'ignore', 'error', 'errorifexists', 'default'.` After this PR, the error will have a proper error class: `[INVALID_SAVE_MODE] The specified save mode "foo" is invalid. Valid save modes include "append", "overwrite", "ignore", "error", "errorifexists", and "default"." ` ### Does this PR introduce _any_ user-facing change? Yes. The error messages will be changed. ### How was this patch tested? New unit test ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#44508 from allisonwang-db/spark-46524-invalid-save-mode. Authored-by: allisonwang-db <allison.wang@databricks.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
- Loading branch information
1 parent
f844e78
commit a3d9992
Showing
6 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters