FAQ
Repository: hive
Updated Branches:
   refs/heads/master f90366404 -> a285de00d


HIVE-12993: user and password supplied from URL is overwritten by the empty user and password of the JDBC connection string when it's calling from beeline (Aihua Xu, reviewed by Yongzhi Chen)


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

Branch: refs/heads/master
Commit: a285de00d479584ad3c57afe3864d3feec0037c2
Parents: f903664
Author: Aihua Xu <aihuaxu@apache.org>
Authored: Wed Feb 3 15:27:04 2016 -0500
Committer: Aihua Xu <aihuaxu@apache.org>
Committed: Tue Feb 9 15:53:45 2016 -0500

----------------------------------------------------------------------
  .../apache/hive/beeline/DatabaseConnection.java | 3 ---
  jdbc/src/java/org/apache/hive/jdbc/Utils.java | 17 ++++++++++-------
  2 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/a285de00/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
index 791fec6..c4afa0a 100644
--- a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
+++ b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
@@ -29,7 +29,6 @@ import java.sql.Driver;
  import java.sql.DriverManager;
  import java.sql.ResultSet;
  import java.sql.SQLException;
-import java.util.Arrays;
  import java.util.Collection;
  import java.util.LinkedList;
  import java.util.List;
@@ -44,8 +43,6 @@ import jline.console.completer.ArgumentCompleter;
  import jline.console.completer.Completer;

  class DatabaseConnection {
- private static final String HIVE_AUTH_USER = "user";
- private static final String HIVE_AUTH_PASSWD = "password";
    private static final String HIVE_VAR_PREFIX = "hivevar:";
    private static final String HIVE_CONF_PREFIX = "hiveconf:";


http://git-wip-us.apache.org/repos/asf/hive/blob/a285de00/jdbc/src/java/org/apache/hive/jdbc/Utils.java
----------------------------------------------------------------------
diff --git a/jdbc/src/java/org/apache/hive/jdbc/Utils.java b/jdbc/src/java/org/apache/hive/jdbc/Utils.java
index b27e7bf..080e8fc 100644
--- a/jdbc/src/java/org/apache/hive/jdbc/Utils.java
+++ b/jdbc/src/java/org/apache/hive/jdbc/Utils.java
@@ -384,14 +384,17 @@ class Utils {
      }
      // Extract user/password from JDBC connection properties if its not supplied
      // in the connection URL
- if (info.containsKey(JdbcConnectionParams.AUTH_USER)) {
- connParams.getSessionVars().put(JdbcConnectionParams.AUTH_USER,
- info.getProperty(JdbcConnectionParams.AUTH_USER));
- if (info.containsKey(JdbcConnectionParams.AUTH_PASSWD)) {
- connParams.getSessionVars().put(JdbcConnectionParams.AUTH_PASSWD,
- info.getProperty(JdbcConnectionParams.AUTH_PASSWD));
- }
+ if (!connParams.getSessionVars().containsKey(JdbcConnectionParams.AUTH_USER)) {
+ if (info.containsKey(JdbcConnectionParams.AUTH_USER)) {
+ connParams.getSessionVars().put(JdbcConnectionParams.AUTH_USER,
+ info.getProperty(JdbcConnectionParams.AUTH_USER));
+ }
+ if (info.containsKey(JdbcConnectionParams.AUTH_PASSWD)) {
+ connParams.getSessionVars().put(JdbcConnectionParams.AUTH_PASSWD,
+ info.getProperty(JdbcConnectionParams.AUTH_PASSWD));
+ }
      }
+
      if (info.containsKey(JdbcConnectionParams.AUTH_TYPE)) {
        connParams.getSessionVars().put(JdbcConnectionParams.AUTH_TYPE,
            info.getProperty(JdbcConnectionParams.AUTH_TYPE));

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedFeb 9, '16 at 8:55p
activeFeb 9, '16 at 8:55p
posts1
users1
websitehive.apache.org

1 user in discussion

Aihuaxu: 1 post

People

Translate

site design / logo © 2021 Grokbase