[
https://issues.apache.org/jira/browse/HIVE-13670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15272779#comment-15272779
]
Sushanth Sowmyan commented on HIVE-13670:
-----------------------------------------
!set still lists them, and is able to interact with it in the same way we
interact with other !set variables, they are inside a "beeline.vars.*"
namespace. And that is the naming scheme in use as well.
For the above examples, you'll get something like this:
{noformat}
beeline.vars.lastConnectedUrl=jdbc:hive2://localhost:10000/default/
beeline.vars.blue=jdbc:hive2://localhost:10000/default/
... (and so on for any other saved-saved variable you may use)
{noformat}
basically, what changed with !set is really syntactic sugar for not specifying
a "beeline.vars." prefix for any of these variables.
Agreed, I do not have a good way to unset them. I see that is true for !set in
general across the board as well. I can add a !unset command to add that in.
==
As to the fallback, we do not try to use the connect string and wait to see if
it's a failure - we test if the connect string passed to us is a valid URI. If
it is a uri, we use it. (The error checking is the URI parsing, not
connecting). If it isn't a URI, we conculde it must be a varname and use it if
that's available. Adding a '$' sigil can be done easily to denote whether
something is a variable or not, but I thought it unnecessary here, since URI
parsing is so widely a standard. I do not mind switching on this if you feel
strongly about it.
> 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)