Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-2539

Enable passing username/password via JDBC

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 0.7.1
    • Fix Version/s: None
    • Component/s: JDBC
    • Labels:

      Description

      Changing the username and/or the password seems to have no effect (also confirmed here: https://cwiki.apache.org/Hive/hivejdbcinterface.html).

      Connection con = DriverManager.getConnection("jdbc:hive://localhost:10000/default", "", "");

      Would be beneficial to pass the username/password via JDBC - and also for the server to honor the username password being passed (may be dependent of that being fixed first).

      1. HIVE-2539.PATCH
        2 kB
        chunqing xie

        Activity

        Hide
        xcqnoah chunqing xie added a comment -

        The username and password is processed in HiveConnection.java

        Show
        xcqnoah chunqing xie added a comment - The username and password is processed in HiveConnection.java
        Hide
        xcqnoah chunqing xie added a comment -

        DriverManager.getConnection() with username/password or without username/password are both tested.

        Show
        xcqnoah chunqing xie added a comment - DriverManager.getConnection() with username/password or without username/password are both tested.
        Hide
        mac.hadoop@gmail.com Mac Fang added a comment -

        Why don't we change thrift and add a login method?

        Show
        mac.hadoop@gmail.com Mac Fang added a comment - Why don't we change thrift and add a login method?
        Hide
        mac.hadoop@gmail.com Mac Fang added a comment -

        our solution is enable the login in the thrift RPC and use login when initialize the HiveConnection. Then in HiveServer, we put the username into the SessionState after authentication.

        Show
        mac.hadoop@gmail.com Mac Fang added a comment - our solution is enable the login in the thrift RPC and use login when initialize the HiveConnection. Then in HiveServer, we put the username into the SessionState after authentication.
        Hide
        cwsteinbach Carl Steinbach added a comment -

        Please post a review request on reviewboard or phabricator. Thanks.

        Show
        cwsteinbach Carl Steinbach added a comment - Please post a review request on reviewboard or phabricator. Thanks.
        Hide
        qwertymaniac Harsh J added a comment -

        This should no longer be an issue with the new jdbc:hive2 drivers.

        Show
        qwertymaniac Harsh J added a comment - This should no longer be an issue with the new jdbc:hive2 drivers.
        Hide
        prasadm Prasad Mujumdar added a comment -

        Harsh J Thanks for bringing that up. HiveServer2 and it's JDBC driver support multiple authentication mechanisms.
        I will go ahead and close the issue.

        Mac Fang and chunqing xie Just in case, if you are still interested in submitting the patch for old HiveServer, please feel free to reopen the ticket. Thanks!

        Show
        prasadm Prasad Mujumdar added a comment - Harsh J Thanks for bringing that up. HiveServer2 and it's JDBC driver support multiple authentication mechanisms. I will go ahead and close the issue. Mac Fang and chunqing xie Just in case, if you are still interested in submitting the patch for old HiveServer, please feel free to reopen the ticket. Thanks!
        Hide
        prasadm Prasad Mujumdar added a comment -

        The JDBC driver for HiveServer2 support user/password authentication via JDBC getConnection() API.

        Show
        prasadm Prasad Mujumdar added a comment - The JDBC driver for HiveServer2 support user/password authentication via JDBC getConnection() API.

          People

          • Assignee:
            xcqnoah chunqing xie
            Reporter:
            skrishnan Sriram Krishnan
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development