[ 
https://issues.apache.org/jira/browse/SPARK-57753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Max Gekk resolved SPARK-57753.
------------------------------
    Resolution: Fixed

> Assign a name to the error condition _LEGACY_ERROR_TEMP_3091
> ------------------------------------------------------------
>
>                 Key: SPARK-57753
>                 URL: https://issues.apache.org/jira/browse/SPARK-57753
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 5.0.0
>            Reporter: Max Gekk
>            Assignee: Michael Mitchell
>            Priority: Major
>
> h3. Summary
> The error condition {{_LEGACY_ERROR_TEMP_3091}} is raised when a Hive 
> UDF/UDAF/UDTF declares a *raw* {{java.util.Map}} (no key/value type 
> parameters) in its method signature. Spark cannot infer the map key and value 
> types from a raw map, so type resolution fails. As part of the error-class 
> migration (umbrella SPARK-37935), it should be given a proper, descriptive 
> name.
> h3. Current behavior
> In {{HiveInspectors.javaTypeToDataType}} 
> (sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala):
> {code:scala}
> // raw java map type unsupported
> case c: Class[_] if isSubClassOf(c, classOf[java.util.Map[_, _]]) =>
>   throw new AnalysisException(
>     errorClass = "_LEGACY_ERROR_TEMP_3091", messageParameters = Map.empty)
> {code}
> The unnamed legacy condition is used with an empty message parameter map.
> h3. Proposed change
> * Replace {{_LEGACY_ERROR_TEMP_3091}} with a descriptive error condition for 
> an unsupported raw {{Map}} type whose key/value types cannot be inferred.
> * Add message parameter(s) if useful (e.g. the offending class/type name).
> * Update the affected test to assert via {{checkError}} on the new condition 
> (HiveUDFSuite "UDFRawMap").
> h3. Context
> Found while migrating {{_LEGACY_ERROR_TEMP_3084}} under SPARK-57750. That 
> change wraps Hive UDF/UDAF/UDTF wrapper-instantiation failures in the new 
> {{CANNOT_INSTANTIATE_HIVE_FUNCTION}} condition and attaches the original 
> failure as the exception cause. This condition is one such inner cause, now 
> surfaced via {{getCause}} (see the corresponding test in 
> {{sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala}}).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to