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 a4584e3eaebc052a6870c543bfbfc9e5d78e771b..86df74d26ddd60736214c0f9acb835f4253a2c17 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,16 +556,7 @@ 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()) { - Class functionClass; - try { - functionClass = info.getFunctionClass(); - } catch (Exception e) { - return registerToSessionRegistry(qualifiedName, info); - } - if (functionClass == null) { - return registerToSessionRegistry(qualifiedName, info); - } - return info; + return registerToSessionRegistry(qualifiedName, info); } if (info != null || !isNative) { return info; // We have the UDF, or we are in the session registry (or both). diff --git a/ql/src/java/org/apache/hadoop/hive/ql/util/ResourceDownloader.java b/ql/src/java/org/apache/hadoop/hive/ql/util/ResourceDownloader.java index 14102b5108164616b4cf2e7f7d22c894321f027e..ff084ac91a09629f8e222d888af51aef9af63665 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/util/ResourceDownloader.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/util/ResourceDownloader.java @@ -103,8 +103,11 @@ private String downloadResource(URI srcUri, String subDir, boolean convertToUnix File destinationDir = (subDir == null) ? resourceDir : new File(resourceDir, subDir); ensureDirectory(destinationDir); File destinationFile = new File(destinationDir, new Path(srcUri.toString()).getName()); - FileSystem fs = FileSystem.get(srcUri, conf); String dest = destinationFile.getCanonicalPath(); + if (destinationFile.exists()) { + return dest; + } + FileSystem fs = FileSystem.get(srcUri, conf); fs.copyToLocalFile(new Path(srcUri.toString()), new Path(dest)); // add "execute" permission to downloaded resource file (needed when loading dll file) FileUtil.chmod(dest, "ugo+rx", true);