[SPARK-58363][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_2214-2219 - #57556
Closed
LuciferYang wants to merge 1 commit into
Closed
[SPARK-58363][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_2214-2219#57556LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
…_TEMP_2214-2219 The catalog-plugin loading failures in `Catalogs.load` were reported with six placeholder error conditions `_LEGACY_ERROR_TEMP_2214` through `_LEGACY_ERROR_TEMP_2219`, none of which carried a SQLSTATE. Group the six into a single umbrella error condition `CANNOT_LOAD_CATALOG` (SQLSTATE 46103, consistent with the sibling `CANNOT_LOAD_FUNCTION_CLASS`), with one subclass per failure mode in the `Catalogs.load` try/catch: - NOT_A_CATALOG_PLUGIN (class does not implement CatalogPlugin) - PLUGIN_CLASS_NOT_FOUND (ClassNotFoundException) - CONSTRUCTOR_NOT_FOUND (NoSuchMethodException) - CONSTRUCTOR_NOT_ACCESSIBLE (IllegalAccessException) - ABSTRACT_CLASS (InstantiationException) - CONSTRUCTOR_FAILURE (InvocationTargetException) The failures are triggered by a user-supplied `spark.sql.catalog.<name>` plugin class, so they are user-actionable. This also drops a stray trailing ')' in the legacy _2216/_2217 messages. Existing assertions in `CatalogLoadingSuite` and `SupportsCatalogOptionsSuite` are updated, and tests are added for the previously-uncovered CONSTRUCTOR_NOT_FOUND and ABSTRACT_CLASS subclasses.
uros-b
approved these changes
Jul 27, 2026
Member
|
Thank you @LuciferYang! |
Contributor
Author
|
Merge Summary:
Posted by |
Contributor
Author
|
Merge Summary:
Posted by |
LuciferYang
added a commit
that referenced
this pull request
Jul 27, 2026
…_TEMP_2214-2219
### What changes were proposed in this pull request?
The catalog-plugin loading failures in `Catalogs.load` were reported with six placeholder error conditions `_LEGACY_ERROR_TEMP_2214` through `_LEGACY_ERROR_TEMP_2219`, none of which carried a SQLSTATE.
Group the six into a single umbrella error condition `CANNOT_LOAD_CATALOG` (SQLSTATE `46103`), with one subclass per failure mode in the `Catalogs.load` try/catch:
- `NOT_A_CATALOG_PLUGIN` — the class does not implement `CatalogPlugin`
- `PLUGIN_CLASS_NOT_FOUND` — `ClassNotFoundException`
- `CONSTRUCTOR_NOT_FOUND` — `NoSuchMethodException`
- `CONSTRUCTOR_NOT_ACCESSIBLE` — `IllegalAccessException`
- `ABSTRACT_CLASS` — `InstantiationException`
- `CONSTRUCTOR_FAILURE` — `InvocationTargetException`
This also drops a stray trailing `)` in the legacy `_2216`/`_2217` messages.
### Why are the changes needed?
The error-conditions README disallows new `_LEGACY_ERROR_TEMP_*` entries and asks existing ones to be resolved. This resolves six of them. SQLSTATE `46103` ("Java Error") is consistent with the sibling `CANNOT_LOAD_FUNCTION_CLASS`; the failures are triggered by a user-supplied `spark.sql.catalog.<name>` plugin class, so they are user-actionable rather than system errors.
### Does this PR introduce _any_ user-facing change?
No. The `_LEGACY_ERROR_TEMP_*` names are not part of the public API. Message text is preserved (except the stray `)` typo removal), now rendered under the umbrella prefix.
### How was this patch tested?
Updated the existing `checkError`/condition assertions in `CatalogLoadingSuite` and `SupportsCatalogOptionsSuite`, and added tests for the previously-uncovered `CONSTRUCTOR_NOT_FOUND` and `ABSTRACT_CLASS` subclasses. `build/sbt "catalyst/testOnly *CatalogLoadingSuite" "core/testOnly org.apache.spark.SparkThrowableSuite"` passes.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)
Closes #57556 from LuciferYang/assign-name-legacy-2214-2219.
Authored-by: YangJie <yangjie01@baidu.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
(cherry picked from commit 54d5f51)
Signed-off-by: yangjie01 <yangjie01@baidu.com>
Contributor
Author
|
Tank you @dongjoon-hyun @uros-b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
The catalog-plugin loading failures in
Catalogs.loadwere reported with six placeholder error conditions_LEGACY_ERROR_TEMP_2214through_LEGACY_ERROR_TEMP_2219, none of which carried a SQLSTATE.Group the six into a single umbrella error condition
CANNOT_LOAD_CATALOG(SQLSTATE46103), with one subclass per failure mode in theCatalogs.loadtry/catch:NOT_A_CATALOG_PLUGIN— the class does not implementCatalogPluginPLUGIN_CLASS_NOT_FOUND—ClassNotFoundExceptionCONSTRUCTOR_NOT_FOUND—NoSuchMethodExceptionCONSTRUCTOR_NOT_ACCESSIBLE—IllegalAccessExceptionABSTRACT_CLASS—InstantiationExceptionCONSTRUCTOR_FAILURE—InvocationTargetExceptionThis also drops a stray trailing
)in the legacy_2216/_2217messages.Why are the changes needed?
The error-conditions README disallows new
_LEGACY_ERROR_TEMP_*entries and asks existing ones to be resolved. This resolves six of them. SQLSTATE46103("Java Error") is consistent with the siblingCANNOT_LOAD_FUNCTION_CLASS; the failures are triggered by a user-suppliedspark.sql.catalog.<name>plugin class, so they are user-actionable rather than system errors.Does this PR introduce any user-facing change?
No. The
_LEGACY_ERROR_TEMP_*names are not part of the public API. Message text is preserved (except the stray)typo removal), now rendered under the umbrella prefix.How was this patch tested?
Updated the existing
checkError/condition assertions inCatalogLoadingSuiteandSupportsCatalogOptionsSuite, and added tests for the previously-uncoveredCONSTRUCTOR_NOT_FOUNDandABSTRACT_CLASSsubclasses.build/sbt "catalyst/testOnly *CatalogLoadingSuite" "core/testOnly org.apache.spark.SparkThrowableSuite"passes.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)