Skip to content

[SPARK-58363][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_2214-2219 - #57556

Closed
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-2214-2219
Closed

[SPARK-58363][SQL] Assign a name to the error condition _LEGACY_ERROR_TEMP_2214-2219#57556
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-2214-2219

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

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_FOUNDClassNotFoundException
  • CONSTRUCTOR_NOT_FOUNDNoSuchMethodException
  • CONSTRUCTOR_NOT_ACCESSIBLEIllegalAccessException
  • ABSTRACT_CLASSInstantiationException
  • CONSTRUCTOR_FAILUREInvocationTargetException

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)

…_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

uros-b commented Jul 27, 2026

Copy link
Copy Markdown
Member

Thank you @LuciferYang!

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@LuciferYang

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@LuciferYang

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

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>
@LuciferYang

Copy link
Copy Markdown
Contributor Author

Tank you @dongjoon-hyun @uros-b

@LuciferYang
LuciferYang deleted the assign-name-legacy-2214-2219 branch July 27, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants