Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
4.0.0
Description
When using spark.sql.error.messageFormat in MINIMAL or STANDARD mode the SQLSTATE is exposed;
We want to extend this to PRETTY mode, now that all errors have SQLSTATEs
We propose to trail the SQLSTATE after the text message, so it does not take away from the reading experience of the message, while still being easily found by tooling or humans.
[<errorClass>] <message> SQLSTATE: <state>
<context>
Example:
[DIVIDE_BY_ZERO] ** Division by zero. Use `try_divide` to tolerate divisor being 0 and return NULL instead. If necessary set "spark.sql.ansi.enabled" to "false" to bypass this error. SQLSTATE: 22013
== SQL(line 1, position 8){{{}==
{}}}{{{}SELECT 1/0
{}}} ^^^
Other options considered have been:
[DIVIDE_BY_ZERO](22013) ** Division by zero. Use `try_divide` to tolerate divisor being 0 and return NULL instead. If necessary set "spark.sql.ansi.enabled" to "false" to bypass this error.
== SQL(line 1, position 8){{{}==
{}}}{{{}SELECT 1/0
{}}} ^^^
and
{{[DIVIDE_BY_ZERO] ** Division by zero. Use `try_divide` to tolerate divisor being 0 and return NULL instead. If necessary set "spark.sql.ansi.enabled" to "false" to bypass this error.
== SQL(line 1, position 8)==
SELECT 1/0
^^^
{{SQLSTATE: 22013}}
}}{}{{{}}}
Attachments
Issue Links
- links to