Ma77Ball opened a new pull request, #57287:
URL: https://github.com/apache/spark/pull/57287
### What changes were proposed in this pull request?
Assign the name `RESERVED_DATABASE_NAME` to the legacy error condition
`_LEGACY_ERROR_TEMP_1066`. This error is raised when a user tries to create a
database using the system-preserved name (`global_temp`). The new condition is
given SQLSTATE `42939` ("the name cannot be used, because the specified
identifier is reserved for system use").
### 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
rendered message becomes "Cannot create the database `global_temp` because the
name is reserved for system use." (previously "global_temp is a system
preserved database, you cannot create a database with this name.").
### How was this patch tested?
Added a `checkError` test in `QueryCompilationErrorsSuite` that runs `CREATE
DATABASE global_temp` and asserts the `RESERVED_DATABASE_NAME` condition.
`build/sbt "core/testOnly *SparkThrowableSuite"` and the new test in
`QueryCompilationErrorsSuite` pass.
### Was this patch authored or co-authored using generative AI tooling?
--
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]