Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/18768#discussion_r130217731
--- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala
---
@@ -111,6 +112,31 @@ private[hive] object HiveShim {
}
}
+ private def isSubClassOf(t: Type, parent: Class[_]): Boolean = t match {
+ case cls: Class[_] => parent.isAssignableFrom(cls)
+ case _ => false
+ }
+
+ private def hasInheritanceOf[UDFType: ClassTag](funcName: String, clazz:
Class[_]): Boolean = {
+ val clsTag = classTag[UDFType].runtimeClass
+ if (isSubClassOf(clazz, clsTag)) {
+ val funcClass = clazz.getMethod(funcName, classOf[MapredContext])
+ funcClass.getDeclaringClass != clsTag
+ } else {
+ false
+ }
+ }
+
+ def validateHiveUserDefinedFunction(udfClass: Class[_]): Unit = {
+ if (hasInheritanceOf[GenericUDF]("configure", udfClass) ||
--- End diff --
When `GenericUDF` API has `configure` method? Seems `GenericUDF` at 0.10.0
has no such method?
https://hive.apache.org/javadocs/r0.10.0/api/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.html
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]