Hive
  1. Hive
  2. HIVE-2539

Enable passing username/password via JDBC

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major 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

        Sriram Krishnan created issue -
        Hide
        chunqing xie added a comment -

        The username and password is processed in HiveConnection.java

        Show
        chunqing xie added a comment - The username and password is processed in HiveConnection.java
        chunqing xie made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        Labels patch
        chunqing xie made changes -
        Attachment HIVE-2539.PATCH [ 12514106 ]
        Hide
        chunqing xie added a comment -

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

        Show
        chunqing xie added a comment - DriverManager.getConnection() with username/password or without username/password are both tested.
        Ashutosh Chauhan made changes -
        Assignee chunqing xie [ xcqnoah ]
        Hide
        Mac Fang added a comment -

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

        Show
        Mac Fang added a comment - Why don't we change thrift and add a login method?
        Hide
        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 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
        Carl Steinbach added a comment -

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

        Show
        Carl Steinbach added a comment - Please post a review request on reviewboard or phabricator. Thanks.
        Carl Steinbach made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Harsh J added a comment -

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

        Show
        Harsh J added a comment - This should no longer be an issue with the new jdbc:hive2 drivers.
        Hide
        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
        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
        Prasad Mujumdar added a comment -

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

        Show
        Prasad Mujumdar added a comment - The JDBC driver for HiveServer2 support user/password authentication via JDBC getConnection() API.
        Prasad Mujumdar made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Implemented [ 10 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        101d 12h 15m 1 chunqing xie 10/Feb/12 14:09
        Patch Available Patch Available Open Open
        249d 11h 10m 1 Carl Steinbach 17/Oct/12 02:19
        Open Open Resolved Resolved
        525d 19h 40m 1 Prasad Mujumdar 26/Mar/14 21:00

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development