sunchao commented on a change in pull request #30665:
URL: https://github.com/apache/spark/pull/30665#discussion_r550304285
##########
File path:
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala
##########
@@ -91,8 +91,18 @@ private[sql] class HiveSessionCatalog(
isUDAFBridgeRequired = true))
udfExpr.get.dataType // Force it to check input data types.
} else if (classOf[GenericUDTF].isAssignableFrom(clazz)) {
- udfExpr = Some(HiveGenericUDTF(name, new
HiveFunctionWrapper(clazz.getName), input))
- udfExpr.get.asInstanceOf[HiveGenericUDTF].elementSchema // Force
it to check data types.
+ try {
+ udfExpr = Some(HiveGenericUDTF(name, new
HiveFunctionWrapper(clazz.getName), input))
+ // Force it to check input data types.
+ udfExpr.get.asInstanceOf[HiveGenericUDTF].elementSchema
+ } catch {
+ case exception: Exception =>
Review comment:
why do we need this fallback mechanism? can we just switch to the new
API without the `deprecated` flag?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]