Skip to content

[SPARK-57752][SPARK-57753][SPARK-57754][SQL] Assign names to Hive UDF Java type error conditions#56905

Open
michaelmitchell-bit wants to merge 1 commit into
apache:masterfrom
michaelmitchell-bit:SPARK-57752-57753-57754-hive-udf-error-classes
Open

[SPARK-57752][SPARK-57753][SPARK-57754][SQL] Assign names to Hive UDF Java type error conditions#56905
michaelmitchell-bit wants to merge 1 commit into
apache:masterfrom
michaelmitchell-bit:SPARK-57752-57753-57754-hive-udf-error-classes

Conversation

@michaelmitchell-bit

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR assigns named error conditions and SQLSTATEs for three Hive UDF/UDAF/UDTF Java type legacy error classes:

  • _LEGACY_ERROR_TEMP_3090 -> UNSUPPORTED_HIVE_FUNCTION_TYPE.RAW_LIST
  • _LEGACY_ERROR_TEMP_3091 -> UNSUPPORTED_HIVE_FUNCTION_TYPE.RAW_MAP
  • _LEGACY_ERROR_TEMP_3092 -> UNSUPPORTED_HIVE_FUNCTION_TYPE.WILDCARD

The three conditions share the UNSUPPORTED_HIVE_FUNCTION_TYPE parent with SQLSTATE 0A000 because all three cases reject unsupported Hive function Java type signatures while Spark infers Catalyst types.

Why are the changes needed?

To replace temporary legacy error classes with stable named error conditions and SQLSTATEs.

Does this PR introduce any user-facing change?

Yes. The affected errors now report named error conditions and SQLSTATEs, and their messages are grouped under the new UNSUPPORTED_HIVE_FUNCTION_TYPE condition.

How was this patch tested?

Ran targeted tests:

./build/sbt "core/testOnly org.apache.spark.SparkThrowableSuite"
./build/sbt "hive/testOnly org.apache.spark.sql.hive.execution.HiveUDFSuite -- -z \"UDFRaw\""
./build/sbt "hive/testOnly org.apache.spark.sql.hive.execution.HiveUDFSuite -- -z \"UDFWildcardList\""

Also ran:

jq empty common/utils/src/main/resources/error/error-conditions.json
git diff --check

Was this patch authored or co-authored using generative AI tooling?

Generated-by: OpenAI Codex

@MaxGekk MaxGekk 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.

0 blocking, 0 non-blocking, 0 nits.
Clean legacy-error-class assignment — _LEGACY_ERROR_TEMP_3090/3091/3092UNSUPPORTED_HIVE_FUNCTION_TYPE.{RAW_LIST,RAW_MAP,WILDCARD}. LGTM.

Verification

  • Registry well-formed: alphabetical placement (UNSUPPORTED_GROUPING_EXPRESSION < UNSUPPORTED_HIVE_FUNCTION_TYPE < UNSUPPORTED_HIVE_METASTORE_VERSION_FOR_JAVA; subclasses RAW_LIST < RAW_MAP < WILDCARD), 0A000 set (satisfies "SQLSTATE is mandatory"), and the three assembled templates are distinct — so SparkThrowableSuite's formatting/uniqueness checks pass. Structure mirrors the existing UNSUPPORTED_FEATURE parent-with-subclasses.
  • No dangling references: a repo-wide grep for the three removed legacy classes finds only the six sites this PR updates.
  • Call sites + tests consistent: messageParameters = Map.empty matches the no-parameter messages, and all three subclasses are exercised (testUDFRawList/testUDFRawMap/testUDFWildcardList).
  • Docs: no manual update needed — docs/sql-error-conditions.md is auto-derived from error-conditions.json via docs/_plugins/build-error-docs.py.

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.

2 participants