[ 
https://issues.apache.org/jira/browse/SPARK-45595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Serge Rielau updated SPARK-45595:
---------------------------------
    Summary: Expose SQLSTATE in error message  (was: Expose SQLSTATRE in 
errormessage)

> Expose SQLSTATE in error message
> --------------------------------
>
>                 Key: SPARK-45595
>                 URL: https://issues.apache.org/jira/browse/SPARK-45595
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 4.0.0
>            Reporter: Serge Rielau
>            Priority: Major
>
> 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}}}}
> }}{{{}{{}}{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to