gatorsmile opened a new pull request, #57540:
URL: https://github.com/apache/spark/pull/57540

   ### What changes were proposed in this pull request?
   
   Assign the name `WRITING_JOB_FAILED` to the legacy error condition
   `_LEGACY_ERROR_TEMP_2070`. This error is a `SparkException` raised by
   `QueryExecutionErrors.writingJobFailedError`, thrown by 
`WriteToDataSourceV2Exec`
   when a DataSource V2 batch write fails and the subsequent `abort()` also 
fails (the
   original cause is chained onto the exception). The new condition is given 
SQLSTATE
   `58030` (matching the sibling `TASK_WRITE_FAILED`); it stays parameterless 
and
   preserves the chained `cause`.
   
   ### Why are the changes needed?
   
   The error conditions 
[README](https://github.com/apache/spark/blob/master/common/utils/src/main/resources/error/README.md)
   disallows new `_LEGACY_ERROR_TEMP_*` entries and asks existing ones to be 
assigned
   proper names. This resolves one of them, under the umbrella
   [SPARK-37935](https://issues.apache.org/jira/browse/SPARK-37935).
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The `_LEGACY_ERROR_TEMP_*` names are not part of the public API. The 
error
   condition name changes to `WRITING_JOB_FAILED` and now reports SQLSTATE 
`58030`; the
   message text ("Writing job failed.") is unchanged.
   
   ### How was this patch tested?
   
   Added a `checkError` test in `DataSourceV2Suite` with a new
   `CommitAndAbortFailingDataSource` whose batch write fails to commit and then 
fails to
   abort, driving the exact `WriteToDataSourceV2Exec` branch that raises
   `WRITING_JOB_FAILED`. `SparkThrowableSuite` validates SQLSTATE presence and
   error-file formatting/sorting for the new entry.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Claude Opus 4.8)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to