[
https://issues.apache.org/jira/browse/HIVE-13670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sushanth Sowmyan updated HIVE-13670:
------------------------------------
Attachment: HIVE-13670.3.patch
New patch up, with changed semantics.
First and foremost, there is no notion of saved vars from the previous patch.
We might want to re-introduce that at some point, but not in this patch.
Replacing it is usage of environment variables. That is particularly useful,
because it allows cluster-administrators to use something like ambari to set an
env variable for users, and then beeline users can use "names" given to them by
the cluster admin.
What this patch has is as follows:
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"
c) Beeline uses reflection in very creative ways to make sense of BeeLineOpts,
and people adding getters and setters in BeeLineOpts had unintended
side-effects. I've added a \@Ignore annotation inside BeeLineOpts to help with
that.
d) Basic tests for the above two additions.
> Improve Beeline reconnect semantics
> -----------------------------------
>
> Key: HIVE-13670
> URL: https://issues.apache.org/jira/browse/HIVE-13670
> Project: Hive
> Issue Type: Improvement
> Affects Versions: 2.1.0
> Reporter: Sushanth Sowmyan
> Assignee: Sushanth Sowmyan
> Attachments: HIVE-13670.2.patch, HIVE-13670.3.patch, HIVE-13670.patch
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)