hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject hive git commit: HIVE-20583: Use canonical hostname only for kerberos auth in HiveConnection (Prasanth Jayachandran reviewed by Gopal V)
Date Tue, 18 Sep 2018 18:49:03 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-3 f8f0ca50a -> 204a0e211


HIVE-20583: Use canonical hostname only for kerberos auth in HiveConnection (Prasanth Jayachandran
reviewed by Gopal V)


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

Branch: refs/heads/branch-3
Commit: 204a0e211d6a60e7151b4b937f774bb86e327df9
Parents: f8f0ca5
Author: Prasanth Jayachandran <prasanthj@apache.org>
Authored: Tue Sep 18 09:58:06 2018 -0700
Committer: Prasanth Jayachandran <prasanthj@apache.org>
Committed: Tue Sep 18 11:48:30 2018 -0700

----------------------------------------------------------------------
 .../src/java/org/apache/hive/jdbc/HiveConnection.java | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/204a0e21/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
----------------------------------------------------------------------
diff --git a/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java b/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
index 458158e..14939cb 100644
--- a/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
+++ b/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
@@ -171,9 +171,13 @@ public class HiveConnection implements java.sql.Connection {
     // sess_var_list -> sessConfMap
     // hive_conf_list -> hiveConfMap
     // hive_var_list -> hiveVarMap
-    host = Utils.getCanonicalHostName(connParams.getHost());
-    port = connParams.getPort();
     sessConfMap = connParams.getSessionVars();
+    if (isKerberosAuthMode()) {
+      host = Utils.getCanonicalHostName(connParams.getHost());
+    } else {
+      host = connParams.getHost();
+    }
+    port = connParams.getPort();
     isEmbeddedMode = connParams.isEmbeddedMode();
 
     if (sessConfMap.containsKey(JdbcConnectionParams.FETCH_SIZE)) {
@@ -241,7 +245,11 @@ public class HiveConnection implements java.sql.Connection {
             }
             // Update with new values
             jdbcUriString = connParams.getJdbcUriString();
-            host = Utils.getCanonicalHostName(connParams.getHost());
+            if (isKerberosAuthMode()) {
+              host = Utils.getCanonicalHostName(connParams.getHost());
+            } else {
+              host = connParams.getHost();
+            }
             port = connParams.getPort();
           } else {
             errMsg = warnMsg;


Mime
View raw message