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

Improve Beeline connect/reconnect semantics

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Release Note:
      Hide
      Couple of usability changes to beeline:

      a) reconnect semantics: !reconnect will re-connect using the same last used connect url after doing a !close. In addition, if you do a !save after connecting, then that url is recoreded in beeline.properties, and can be referred to in any future session, simply by running !reconnect in the beeline shell, or by running beeline as beeline -r.

      b) named connect strings using env variables : Now, !connect as well as beeline -u can take non-url parameters which are assumed to be the name of a cluster/etc, as follows. If there is a env variable called BEELINE_URL_BLUE=<jdbc url>, then specifying "!connect blue" or "beeline -u blue" will pick that up and use that appropriate jdbc url. A suggested use for cluster admins will probably be to define something like a BEELINE_URL_DEFAULT and recommend that users use a "beeline -u default"
      Show
      Couple of usability changes to beeline: a) reconnect semantics: !reconnect will re-connect using the same last used connect url after doing a !close. In addition, if you do a !save after connecting, then that url is recoreded in beeline.properties, and can be referred to in any future session, simply by running !reconnect in the beeline shell, or by running beeline as beeline -r. b) named connect strings using env variables : Now, !connect as well as beeline -u can take non-url parameters which are assumed to be the name of a cluster/etc, as follows. If there is a env variable called BEELINE_URL_BLUE=<jdbc url>, then specifying "!connect blue" or "beeline -u blue" will pick that up and use that appropriate jdbc url. A suggested use for cluster admins will probably be to define something like a BEELINE_URL_DEFAULT and recommend that users use a "beeline -u default"

      Description

      For most users of beeline, chances are that they will be using it with a single HS2 instance most of the time. In this scenario, having them type out a jdbc uri for HS2 every single time to !connect can get tiresome. Thus, we should improve semantics so that if a user does a successful !connect, then we must store the last-connected-to-url, so that if they do a !close, and then a !reconnect, then !reconnect should attempt to connect to the last successfully used url.

      Also, if they then do a !save, then that last-successfully-used url must be saved, so that in subsequent sessions, they can simply do !reconnect rather than specifying a url for !connect.

      In addition, it would be useful to introduce a new way of doing !connect that does involve typing out a jdbc url every time (since this is highly likely to be error-prone)

        Attachments

        1. HIVE-13670.patch
          2 kB
          Sushanth Sowmyan
        2. HIVE-13670.4.patch
          15 kB
          Sushanth Sowmyan
        3. HIVE-13670.3.patch
          15 kB
          Sushanth Sowmyan
        4. HIVE-13670.2.patch
          11 kB
          Sushanth Sowmyan

          Activity

            People

            • Assignee:
              sushanth Sushanth Sowmyan
              Reporter:
              sushanth Sushanth Sowmyan
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: