diff --git a/service/src/java/org/apache/hive/service/cli/CLIService.java b/service/src/java/org/apache/hive/service/cli/CLIService.java index 883bf9b..1a04a68 100644 --- a/service/src/java/org/apache/hive/service/cli/CLIService.java +++ b/service/src/java/org/apache/hive/service/cli/CLIService.java @@ -77,11 +77,6 @@ public CLIService(HiveServer2 hiveServer2) { @Override public synchronized void init(HiveConf hiveConf) { - try { - applyAuthorizationConfigPolicy(hiveConf); - } catch (HiveException e) { - throw new RuntimeException("Error applying authorization policy on hive configuration", e); - } this.hiveConf = hiveConf; sessionManager = new SessionManager(hiveServer2); addService(sessionManager); @@ -111,6 +106,12 @@ public synchronized void init(HiveConf hiveConf) { } } } + // creates connection to HMS and thus *must* occur after kerberos login above + try { + applyAuthorizationConfigPolicy(hiveConf); + } catch (HiveException e) { + throw new RuntimeException("Error applying authorization policy on hive configuration", e); + } setupBlockedUdfs(); super.init(hiveConf); }