Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 57722bac3 -> 41813bc01


AMBARI-16868. Insert Statement in Hive View is giving error in Kerberised 
cluster.(Gaurav Nagar via pallavkul)


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

Branch: refs/heads/branch-2.4
Commit: 41813bc011a77346949ae8bebc3b4309fef76dee
Parents: 57722ba
Author: Pallav Kulshreshtha <[email protected]>
Authored: Fri May 27 17:25:08 2016 +0530
Committer: Pallav Kulshreshtha <[email protected]>
Committed: Fri May 27 17:26:38 2016 +0530

----------------------------------------------------------------------
 .../view/hive/client/ConnectionFactory.java     | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/41813bc0/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/ConnectionFactory.java
----------------------------------------------------------------------
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/ConnectionFactory.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/ConnectionFactory.java
index 7a44a2d..0eb7906 100644
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/ConnectionFactory.java
+++ 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/ConnectionFactory.java
@@ -129,22 +129,22 @@ public class ConnectionFactory implements 
UserLocalFactory<Connection> {
     return params;
   }
 
-  private Map<String,String> getDefaultAuthParams(){
-    Map<String,String> params = new HashMap<String,String>();
-    String auth = getProperty(HIVE_SITE,HIVE_SERVER2_AUTHENTICATION);
-    params.put("auth",auth);
-
-    if(auth.equalsIgnoreCase("KERBEROS")){
-      
params.put("principal",getProperty(HIVE_SITE,HIVE_SERVER2_KERBEROS_PRINCIPAL));
-      params.put(Utils.HiveAuthenticationParams.HS2_PROXY_USER,"${username}");
-    } else if(auth.equalsIgnoreCase("LDAP") || 
auth.equalsIgnoreCase("CUSTOM")){
-      params.put("auth","NONE");
-      params.put("password","${ask_password}");
+  private Map<String, String> getDefaultAuthParams() {
+    Map<String, String> params = new HashMap<String, String>();
+    String auth = getProperty(HIVE_SITE, HIVE_SERVER2_AUTHENTICATION);
+    params.put("auth", auth);
+
+    if (auth.equalsIgnoreCase("KERBEROS")) {
+      params.put("principal", getProperty(HIVE_SITE, 
HIVE_SERVER2_KERBEROS_PRINCIPAL));
+      params.put(Utils.HiveAuthenticationParams.HS2_PROXY_USER, 
context.getUsername());
+    } else if (auth.equalsIgnoreCase("LDAP") || 
auth.equalsIgnoreCase("CUSTOM")) {
+      params.put("auth", "NONE");
+      params.put("password", "${ask_password}");
     }
 
-    String qop = getProperty(HIVE_SITE,HIVE_SASL_QOP);
-    if(qop != null && !qop.equals("auth")){
-      params.put(Utils.HiveAuthenticationParams.AUTH_QOP,qop);
+    String qop = getProperty(HIVE_SITE, HIVE_SASL_QOP);
+    if (qop != null && !qop.equals("auth")) {
+      params.put(Utils.HiveAuthenticationParams.AUTH_QOP, qop);
     }
     return params;
   }

Reply via email to