gatorsmile opened a new pull request, #57539:
URL: https://github.com/apache/spark/pull/57539
### What changes were proposed in this pull request?
Assign the name `EMPTY_COLLECTION_NOT_ALLOWED` to the legacy error condition
`_LEGACY_ERROR_TEMP_3014`. This error is a
`SparkUnsupportedOperationException`
raised by `SparkCoreErrors.emptyCollectionError`, thrown by RDD
reduce/first-style
operations on an empty RDD (`RDD.scala`). The new condition is given SQLSTATE
`0A000`; the message text ("empty collection") and its parameterless shape
are
unchanged.
### 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 `EMPTY_COLLECTION_NOT_ALLOWED` and now reports
SQLSTATE
`0A000`; the underlying message text ("empty collection") is unchanged.
### How was this patch tested?
Updated the "empty RDD" test in `RDDSuite` from a `getMessage.contains`
assertion to
`checkError` on the `EMPTY_COLLECTION_NOT_ALLOWED` condition. Other RDD
tests that hit
this path assert only the exception type (`UnsupportedOperationException`),
which still
holds since `SparkUnsupportedOperationException` extends it.
`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]