You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2017/11/27 23:16:52 UTC

hive git commit: HIVE-18029 : beeline - support proper usernames based on the URL arg (Sergey Shelukhin, reviewed by Vaibhav Gumashta)

Repository: hive
Updated Branches:
  refs/heads/master 2b730524f -> a21742ebb


HIVE-18029 : beeline - support proper usernames based on the URL arg (Sergey Shelukhin, reviewed by Vaibhav Gumashta)


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

Branch: refs/heads/master
Commit: a21742ebb4aad3d550bca86d4249d8b7b7fbdb18
Parents: 2b73052
Author: sergey <se...@apache.org>
Authored: Mon Nov 27 15:07:13 2017 -0800
Committer: sergey <se...@apache.org>
Committed: Mon Nov 27 15:07:13 2017 -0800

----------------------------------------------------------------------
 beeline/src/java/org/apache/hive/beeline/BeeLine.java | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/a21742eb/beeline/src/java/org/apache/hive/beeline/BeeLine.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
index 649edc0..add0298 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -865,6 +865,18 @@ public class BeeLine implements Closeable {
 
 
     if (url != null) {
+      // Specifying username/password/driver explicitly will override the values from the url;
+      // make sure we don't override the values present in the url with empty values.
+      if (user == null) {
+        user = Utils.parsePropertyFromUrl(url, JdbcConnectionParams.AUTH_USER);
+      }
+      if (pass == null) {
+        pass = Utils.parsePropertyFromUrl(url, JdbcConnectionParams.AUTH_PASSWD);
+      }
+      if (driver == null) {
+        driver = Utils.parsePropertyFromUrl(url, JdbcConnectionParams.PROPERTY_DRIVER);
+      }
+
       String com;
       String comForDebug;
       if(pass != null) {