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

        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
        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.
        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.
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development