Repository: ambari Updated Branches: refs/heads/trunk fb509d480 -> 2a632995b
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/2a632995 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2a632995 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2a632995 Branch: refs/heads/trunk Commit: 2a632995bcf3f4531e6abf320a21cd78ea71ea0b Parents: fb509d4 Author: Pallav Kulshreshtha <[email protected]> Authored: Fri May 27 17:25:08 2016 +0530 Committer: Pallav Kulshreshtha <[email protected]> Committed: Fri May 27 17:25:08 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/2a632995/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; }
