[
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15342345#comment-15342345
]
Vihang Karajgaonkar commented on HIVE-14063:
--------------------------------------------
I am thinking of adding a file in HIVE_CONF which will be called
beeline-default.properties.template . This file will have comments and
explanation of various properties which could be added. All the properties in
this template will be commented by default. User can copy this template file
and create beeline-default.properties in $HIVE_CONF location
(beeline.properties is already present in the code base and we cannot use that
name since it is causing class load order issues). User can modified the copied
file and uncomment the properties while providing their values as per need like
url, user, password (principal in case of Kerberos enabled environment).
When beeline is started as a part of its initialization, beeline will look for
beeline-default.properties file in $HIVE_CONF location. If the file is found it
will parse it to get the default url, user,password and attempt to connect to
the hs2 using the information provided. If the user decides not to provide
password in the file, beeline will ask for it when attempting to connect to the
default url.
User has the ability to disregard this auto-connect feature by not providing
beeline-default.properties. If the file is not found, beeline will default to
current behavior where it will expect the user to use !connect or other
commands to initiate the connection.
If the user needs to connect to a different url user can still use the existing
ways to provide it using beeline -u commands or create another property-file
similar to earlier (location of this file is not bound to $HIVE_CONF) and use
the beeline --property-file <path to file> command to initiate the connection.
The design adds the ability for the user to have a default connection
information (probably common to most use-cases) but at the same time doesn't
limit the experience/flexibility of Beeline to be able to connect to other urls.
[~spena], [~xuefuz] [~dlo] [~sircodesalot] [~aihuaxu] please review the design
approach above and let me know if you can think of any problems.
Anyone else interested please feel free to chim in. Thanks!
> beeline to auto connect to the HiveServer2
> ------------------------------------------
>
> Key: HIVE-14063
> URL: https://issues.apache.org/jira/browse/HIVE-14063
> Project: Hive
> Issue Type: Improvement
> Components: Beeline
> Reporter: Vihang Karajgaonkar
> Assignee: Vihang Karajgaonkar
> Priority: Minor
>
> Currently one has to give an jdbc:hive2 url in order for Beeline to connect a
> hiveserver2 instance. It would be great if Beeline can get the info somehow
> (from a properties file at a well-known location?) and connect automatically
> if user doesn't specify such a url. If the properties file is not present,
> then beeline would expect user to provide the url and credentials using
> !connect or ./beeline -u .. commands
> While Beeline is flexible (being a mere JDBC client), most environments would
> have just a single HS2. Having users to manually connect into this via either
> "beeline ~/.propsfile" or -u or !connect statements is lowering the
> experience part.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)