Skip to content

[SPARK-58238][SQL] Assign names to the error conditions _LEGACY_ERROR_TEMP_3093-3095#57400

Closed
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-3093-3095
Closed

[SPARK-58238][SQL] Assign names to the error conditions _LEGACY_ERROR_TEMP_3093-3095#57400
LuciferYang wants to merge 1 commit into
apache:masterfrom
LuciferYang:assign-name-legacy-3093-3095

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

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: ."; the _3094/_3095 paths now render the standard "Unsupported data type ." 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)

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

@uros-b uros-b 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.

Thank you @LuciferYang!

@LuciferYang

Copy link
Copy Markdown
Contributor Author
image

all test passed

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

Copy link
Copy Markdown
Contributor Author

Merge Summary:

Posted by merge_spark_pr.py

@LuciferYang

Copy link
Copy Markdown
Contributor Author

Thank you @HyukjinKwon and @uros-b

@LuciferYang
LuciferYang deleted the assign-name-legacy-3093-3095 branch July 22, 2026 04:56
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