[ 
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.2.patch

Updated patch with a bunch of new semantics.

Firstly, !reconnect works to re-open !close-ed connections within the same 
session, as with the previous patch.

Secondly, !reconnect now works across beeline instances if we do a !save after 
the connect. (Basically, we save the lastConnectedUrl in a special variable, 
and use that to reconnect).

Next, we introduce the notion of named "saved" variables, so that a user can do 
something like :

{noformat}
!set blue jdbc:hive2://localhost:10000/default/
!connect blue
{noformat}

In addition, these named variables are also saved and a "!connect blue" will 
work in the next session along if a !save is done after the variable is !set.

Finally, a couple of commandline parameters have been added, so that "-u" now 
takes a named variable, in addition to accepting only urls (if it determines 
that the -u parameter is not a url, it will try to resolve it as a named saved 
variable to read.) Thus, "-u blue" would then be the equivalent of "-u 
jdbc:hive2://localhost:10000/default/" which makes beeline a bit more friendly 
to use. Lastly, a "-r" parameter has been added, which is the equivalent of "-u 
lastConnectedUrl", which works as might be expected from semantics mentioned 
above.

Thanks to [~sladymon] for syntax suggestions and usability input, my original 
stab was much more programmatic/config-based and would probably have been a bit 
more clunky.

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

Reply via email to