You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by am...@apache.org on 2016/07/15 08:41:05 UTC
hive git commit: HIVE-14144 : Fix permanent function loading which is
broken by HIVE-13903 (Rajat Khandelwal, Reviewed by Amareshwari)
Repository: hive
Updated Branches:
refs/heads/master 29a259bea -> 199330a37
HIVE-14144 : Fix permanent function loading which is broken by HIVE-13903 (Rajat Khandelwal, Reviewed by Amareshwari)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/199330a3
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/199330a3
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/199330a3
Branch: refs/heads/master
Commit: 199330a373e16725f2f76a93bc6bd6c85b236f66
Parents: 29a259b
Author: Rajat Khandelwal <pr...@apache.org>
Authored: Fri Jul 15 14:10:48 2016 +0530
Committer: Amareshwari Sriramadasu <am...@apache.org>
Committed: Fri Jul 15 14:10:48 2016 +0530
----------------------------------------------------------------------
ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java | 11 +----------
.../apache/hadoop/hive/ql/util/ResourceDownloader.java | 5 ++++-
2 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hive/blob/199330a3/ql/src/java/org/apache/hadoop/hive/ql/exec/Registry.java
----------------------------------------------------------------------
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 c800a21..05926b5 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
@@ -558,16 +558,7 @@ public class Registry {
// 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).
http://git-wip-us.apache.org/repos/asf/hive/blob/199330a3/ql/src/java/org/apache/hadoop/hive/ql/util/ResourceDownloader.java
----------------------------------------------------------------------
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 14102b5..ff084ac 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 @@ public class ResourceDownloader {
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);