Repository: incubator-sentry
Updated Branches:
  refs/heads/branch-1.4.0 73dcf8967 -> ef78f65ee


SENTRY-1003: Support "reload" by updating the classpath of Sentry function aux 
jar path during runtime. (Dapeng Sun via Anne Yu)


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

Branch: refs/heads/branch-1.4.0
Commit: ef78f65eec2297687cb7ef0e8af3ee281a26829c
Parents: 73dcf89
Author: Anne Yu <[email protected]>
Authored: Mon Jan 25 13:32:01 2016 -0800
Committer: Anne Yu <[email protected]>
Committed: Mon Jan 25 13:38:54 2016 -0800

----------------------------------------------------------------------
 .../org/apache/sentry/binding/hive/HiveAuthzBindingHook.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/ef78f65e/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
----------------------------------------------------------------------
diff --git 
a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
 
b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
index 98820e1..9baf421 100644
--- 
a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
+++ 
b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
@@ -38,6 +38,7 @@ import org.apache.hadoop.hive.ql.HiveDriverFilterHookResult;
 import org.apache.hadoop.hive.ql.HiveDriverFilterHookResultImpl;
 import org.apache.hadoop.hive.ql.exec.SentryGrantRevokeTask;
 import org.apache.hadoop.hive.ql.exec.Task;
+import org.apache.hadoop.hive.ql.exec.Utilities;
 import org.apache.hadoop.hive.ql.hooks.Entity;
 import org.apache.hadoop.hive.ql.hooks.Entity.Type;
 import org.apache.hadoop.hive.ql.hooks.Hook;
@@ -192,7 +193,9 @@ implements HiveDriverFilterHook {
       case HiveParser.TOK_CREATEFUNCTION:
         String udfClassName = 
BaseSemanticAnalyzer.unescapeSQLString(ast.getChild(1).getText());
         try {
-          CodeSource udfSrc = 
Class.forName(udfClassName).getProtectionDomain().getCodeSource();
+          CodeSource udfSrc =
+              Class.forName(udfClassName, true, 
Utilities.getSessionSpecifiedClassLoader())
+                  .getProtectionDomain().getCodeSource();
           if (udfSrc == null) {
             throw new SemanticException("Could not resolve the jar for UDF 
class " + udfClassName);
           }
@@ -203,7 +206,7 @@ implements HiveDriverFilterHook {
           }
           udfURI = parseURI(udfSrc.getLocation().toString(), true);
         } catch (ClassNotFoundException e) {
-          throw new SemanticException("Error retrieving udf class", e);
+          throw new SemanticException("Error retrieving udf class:" + 
e.getMessage(), e);
         }
         // create/drop function is allowed with any database
         currDB = Database.ALL;

Reply via email to