[SPARK-49941][CORE] Rename `errorClass` to `condition` in errors of the JSON format
What changes were proposed in this pull request?
In the PR, I propose to rename the errorClass to condition in errors in the JSON formats: MINIMAL and STANDARD.
For example:
{
"condition" : "DIVIDE_BY_ZERO",
"sqlState" : "22012",
"messageParameters" : { "config" : "CONFIG"}
}
The name condition was taken because it is used the SQL standard:
and no need extra words as a suffix or prefix in the context of error message format.
Why are the changes needed?
To follow new naming convention introduced by https://github.com/apache/spark/pull/44902.
Does this PR introduce any user-facing change?
Yes.
How was this patch tested?
By running the affected tests:
$ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite"
Was this patch authored or co-authored using generative AI tooling?
No.
@srielau @panbingkun @nchammas @cloud-fan Could you review the PR, please.
LGTM.
nit: Do we need to update the following?
@panbingkun Thank you for review.
UIUtils: The nameerrorClassis regexp group name. Not related to the changes.SQLJsonProtocolSuite: it is just an example in a test. It could handle old input.
- UIUtils
Yeah!
- Yes, it is indeed the
groupname of a regular expression. Not related to the changes, and calling it aserrorClasswill not affect the final functionality. (PS: As a follow-up, I'm not sure if we need to rename it tocondiitonto reduce misunderstandings? Because from UT, it seems that its purpose is to obtain the value ofcondiiton(In the past, it was callederrorClass) https://github.com/apache/spark/blob/488f68090b228b30ba4a3b75596c9904eef1f584/core/src/test/scala/org/apache/spark/ui/UIUtilsSuite.scala#L209-L211 (Because after this PR, I believe that in the error log, there should only becondiitonand noerrorClass.) - Okay.
@nchammas Thank you for your comment. I have updated PR's description and added reasons for the name.
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!