[SPARK-58238][SQL] Assign names to the error conditions _LEGACY_ERROR_TEMP_3093-3095#57400
Closed
LuciferYang wants to merge 1 commit into
Closed
[SPARK-58238][SQL] Assign names to the error conditions _LEGACY_ERROR_TEMP_3093-3095#57400LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
…_TEMP_3093-3095 Resolve three legacy error conditions in `HiveInspectors`: - `_LEGACY_ERROR_TEMP_3093` (`javaTypeToDataType` fallthrough for an unsupported Hive UDF Java type) becomes the new subclass `UNSUPPORTED_HIVE_FUNCTION_TYPE.UNKNOWN_TYPE`, alongside the existing `RAW_LIST` / `RAW_MAP` / `WILDCARD` subclasses raised from the same method. - `_LEGACY_ERROR_TEMP_3094` (`decimalTypeInfo`) and `_LEGACY_ERROR_TEMP_3095` (`toTypeInfo` fallthrough) reuse the existing `unsupportedHiveType` helper, which throws `UNSUPPORTED_DATATYPE` — the same condition already used by the sibling `TimeType` branches in those methods. The three legacy entries are removed from `error-conditions.json`. A `checkError` test for the new `UNKNOWN_TYPE` subclass is added in `HiveUDFSuite` (with a `UDFRawSet` UDF that returns a raw `java.util.Set`), and the `HiveScriptTransformationSuite` assertions that checked the old `_3095` message text are updated to `checkError` on `UNSUPPORTED_DATATYPE`.
HyukjinKwon
approved these changes
Jul 21, 2026
Contributor
Author
LuciferYang
added a commit
that referenced
this pull request
Jul 22, 2026
…_TEMP_3093-3095 ### What changes were proposed in this pull request? Resolve three legacy error conditions raised in `HiveInspectors`: - `_LEGACY_ERROR_TEMP_3093` (the `javaTypeToDataType` fallthrough for an unsupported Hive UDF Java type) becomes a new subclass `UNSUPPORTED_HIVE_FUNCTION_TYPE.UNKNOWN_TYPE`, alongside the existing `RAW_LIST` / `RAW_MAP` / `WILDCARD` subclasses raised from the same method. - `_LEGACY_ERROR_TEMP_3094` (`decimalTypeInfo`) and `_LEGACY_ERROR_TEMP_3095` (the `toTypeInfo` fallthrough) reuse the existing `unsupportedHiveType` helper, which throws `UNSUPPORTED_DATATYPE` — the same condition already used by the sibling `TimeType` branches in those two methods. The three legacy entries are removed from `error-conditions.json`. ### Why are the changes needed? The error-conditions README disallows new `_LEGACY_ERROR_TEMP_*` entries and asks existing ones to be resolved. This resolves three of them, reusing existing conditions where the semantics already match (`UNSUPPORTED_DATATYPE`) rather than minting new names. ### Does this PR introduce _any_ user-facing change? No. The `_LEGACY_ERROR_TEMP_*` names are not part of the public API. The `UNKNOWN_TYPE` message renders as "Unsupported Hive UDF/UDAF/UDTF Java type: <c>."; the `_3094`/`_3095` paths now render the standard "Unsupported data type <typeName>." consistent with the neighboring `TimeType` handling. ### How was this patch tested? - Added a `checkError` test in `HiveUDFSuite` (`UDFRawSet`, a UDF returning a raw `java.util.Set`) asserting `UNSUPPORTED_HIVE_FUNCTION_TYPE.UNKNOWN_TYPE`. - Updated the `HiveScriptTransformationSuite` SPARK-32400 tests to `checkError` on `UNSUPPORTED_DATATYPE` (previously asserted the old `_3095` message text). - `build/sbt "hive/testOnly *HiveUDFSuite *HiveScriptTransformationSuite" "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 #57400 from LuciferYang/assign-name-legacy-3093-3095. Authored-by: YangJie <yangjie01@baidu.com> Signed-off-by: yangjie01 <yangjie01@baidu.com> (cherry picked from commit 24f94f4) Signed-off-by: yangjie01 <yangjie01@baidu.com>
Contributor
Author
Contributor
Author
|
Thank you @HyukjinKwon and @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?
Resolve three legacy error conditions raised in
HiveInspectors:_LEGACY_ERROR_TEMP_3093(thejavaTypeToDataTypefallthrough for an unsupported Hive UDF Java type) becomes a new subclassUNSUPPORTED_HIVE_FUNCTION_TYPE.UNKNOWN_TYPE, alongside the existingRAW_LIST/RAW_MAP/WILDCARDsubclasses raised from the same method._LEGACY_ERROR_TEMP_3094(decimalTypeInfo) and_LEGACY_ERROR_TEMP_3095(thetoTypeInfofallthrough) reuse the existingunsupportedHiveTypehelper, which throwsUNSUPPORTED_DATATYPE— the same condition already used by the siblingTimeTypebranches in those two methods.The three legacy entries are removed from
error-conditions.json.Why are the changes needed?
The error-conditions README disallows new
_LEGACY_ERROR_TEMP_*entries and asks existing ones to be resolved. This resolves three of them, reusing existing conditions where the semantics already match (UNSUPPORTED_DATATYPE) rather than minting new names.Does this PR introduce any user-facing change?
No. The
_LEGACY_ERROR_TEMP_*names are not part of the public API. TheUNKNOWN_TYPEmessage renders as "Unsupported Hive UDF/UDAF/UDTF Java type: ."; the_3094/_3095paths now render the standard "Unsupported data type ." consistent with the neighboringTimeTypehandling.How was this patch tested?
checkErrortest inHiveUDFSuite(UDFRawSet, a UDF returning a rawjava.util.Set) assertingUNSUPPORTED_HIVE_FUNCTION_TYPE.UNKNOWN_TYPE.HiveScriptTransformationSuiteSPARK-32400 tests tocheckErroronUNSUPPORTED_DATATYPE(previously asserted the old_3095message text).build/sbt "hive/testOnly *HiveUDFSuite *HiveScriptTransformationSuite" "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)