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 a4584e3..1e2def7 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 @@ -509,11 +509,12 @@ public void unregisterFunction(String functionName) throws HiveException { private void removePersistentFunctionUnderLock(FunctionInfo fi) { Class functionClass = getPermanentUdfClass(fi); Integer refCount = persistent.get(functionClass); - assert refCount != null; - if (refCount == 1) { - persistent.remove(functionClass); - } else { - persistent.put(functionClass, Integer.valueOf(refCount - 1)); + if (refCount != null) { + if (refCount == 1) { + persistent.remove(functionClass); + } else { + persistent.put(functionClass, Integer.valueOf(refCount - 1)); + } } }