panbingkun commented on code in PR #46878:
URL: https://github.com/apache/spark/pull/46878#discussion_r1627556949
##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala:
##########
@@ -178,23 +178,26 @@ object HiveUDFExpressionBuilder extends
SparkUDFExpressionBuilder {
// expressions don't satisfy the hive UDF, such as type mismatch, input
number
// mismatch, etc. Here we catch the exception and throw
AnalysisException instead.
if (classOf[UDF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveSimpleUDF(name, new
HiveFunctionWrapper(clazz.getName), input))
+ udfExpr = Some(HiveSimpleUDF(name, HiveFunctionWrapper(clazz.getName),
input))
udfExpr.get.dataType // Force it to check input data types.
} else if (classOf[GenericUDF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveGenericUDF(name, new
HiveFunctionWrapper(clazz.getName), input))
+ udfExpr = Some(HiveGenericUDF(name,
HiveFunctionWrapper(clazz.getName), input))
udfExpr.get.dataType // Force it to check input data types.
- } else if (classOf[AbstractGenericUDAFResolver].isAssignableFrom(clazz))
{
- udfExpr = Some(HiveUDAFFunction(name, new
HiveFunctionWrapper(clazz.getName), input))
+ } else if (classOf[GenericUDAFResolver2].isAssignableFrom(clazz)) {
Review Comment:
Why do we still handle `GenericUDAFResolver2` separately in the code?
- Because `GenericUDAFResolver` has been marked as `deprecated`, When
removing `GenericUDAFResolver` in subsequent hives, we can easily delete the
logic of `GenericUDAFResolver` here
- In fact, according to inheritance logic, we only need to handle
`GenericUDAFResolver` to cover all `Hive UDAFs` processing (Of course, this
excludes Hive UDAF that directly inherits `UDAF`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]