diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java index 86df74d26ddd60736214c0f9acb835f4253a2c17..a4584e3eaebc052a6870c543bfbfc9e5d78e771b 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java @@ -556,7 +556,16 @@ private FunctionInfo getQualifiedFunctionInfoUnderLock(String qualifiedName) thr // and the current thread may not be able to resolve the UDF. Test for this condition // and if necessary load the JARs in this thread. if (isNative && info != null && info.isPersistent()) { - return registerToSessionRegistry(qualifiedName, info); + Class functionClass; + try { + functionClass = info.getFunctionClass(); + } catch (Exception e) { + return registerToSessionRegistry(qualifiedName, info); + } + if (functionClass == null) { + return registerToSessionRegistry(qualifiedName, info); + } + return info; } if (info != null || !isNative) { return info; // We have the UDF, or we are in the session registry (or both).