You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by da...@apache.org on 2018/05/14 20:26:09 UTC

hive git commit: HIVE-19381: Function replication in cloud fail when download resource from AWS (Daniel Dai, reviewed by Thejas Nair)

Repository: hive
Updated Branches:
  refs/heads/master f6c868a10 -> b96487071


HIVE-19381: Function replication in cloud fail when download resource from AWS (Daniel Dai, reviewed by Thejas Nair)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b9648707
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b9648707
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b9648707

Branch: refs/heads/master
Commit: b96487071f7dc8fdf5aa5a44f90669024fbea9a8
Parents: f6c868a
Author: Daniel Dai <da...@gmail.com>
Authored: Mon May 14 13:25:12 2018 -0700
Committer: Daniel Dai <da...@gmail.com>
Committed: Mon May 14 13:25:12 2018 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionTask.java   | 6 ++++++
 .../java/org/apache/hadoop/hive/ql/session/SessionState.java   | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b9648707/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionTask.java
index a0a90a9..b9d6f58 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionTask.java
@@ -30,6 +30,7 @@ import com.google.common.collect.Multimap;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.metastore.api.Function;
 import org.apache.hadoop.hive.metastore.api.PrincipalType;
 import org.apache.hadoop.hive.metastore.api.ResourceType;
@@ -165,7 +166,9 @@ public class FunctionTask extends Task<FunctionWork> {
     checkLocalFunctionResources(db, createFunctionDesc.getResources());
 
     FunctionInfo registered = null;
+    HiveConf oldConf = SessionState.get().getConf();
     try {
+      SessionState.get().setConf(conf);
       registered = FunctionRegistry.registerPermanentFunction(
         registeredName, className, true, toFunctionResource(resources));
     } catch (RuntimeException ex) {
@@ -173,7 +176,10 @@ public class FunctionTask extends Task<FunctionWork> {
       while (t.getCause() != null) {
         t = t.getCause();
       }
+    } finally {
+      SessionState.get().setConf(oldConf);
     }
+
     if (registered == null) {
       console.printError("Failed to register " + registeredName
           + " using class " + createFunctionDesc.getClassName());

http://git-wip-us.apache.org/repos/asf/hive/blob/b9648707/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
index 6bb756c..89129f9 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
@@ -135,7 +135,7 @@ public class SessionState {
   /**
    * current configuration.
    */
-  private final HiveConf sessionConf;
+  private HiveConf sessionConf;
 
   /**
    * silent mode.
@@ -308,6 +308,9 @@ public class SessionState {
     return sessionConf;
   }
 
+  public void setConf(HiveConf conf) {
+    this.sessionConf = conf;
+  }
 
   public File getTmpOutputFile() {
     return tmpOutputFile;