panbingkun commented on code in PR #46878:
URL: https://github.com/apache/spark/pull/46878#discussion_r1627568220
##########
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:
Placing `GenericUDAFResolver2` in front is to prioritize matching it
--
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]