[ https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416318#comment-15416318 ]
Darren Lo commented on HIVE-14063: ---------------------------------- Hi Vihang, Thanks for considering my points. In my opinion, the fact that we're using a general-purpose JDBC client under the hood should be an implementation detail. If you're trying to make the new HS2-based experience as close as possible to the old Hive CLI experience (which this JIRA is required for, but isn't focused on), part of that is making the configs reasonable to hive users. If hive clients have to know that beeline is a special thing that takes configs in a way they're not used to, that's a burden on those clients. People can probably get past that burden, sure, but if it can be avoided, so much the better. Perhaps when we invoke "hive" (and we want that to internally use beeline / HS2) it can read files from nice, hive-specific locations, and then pass those to beeline in whatever way works for beeline. This hides the beeline details from the hive client. It's a bit trickier when invoking beeline directly if you want to maintain the purity of it being a general-purpose JDBC client. If we use standard Hadoop conf format, clients could decide to leverage the hadoop credential provider to protect / obfuscate passwords. If users are going to connect to an HS2 that is different from what's listed in /etc/hive/conf, then with Sergio's suggestion we can load from somewhere like ~/.hive/ to get those overrides, or they can set HIVE_CONF_DIR=/path/to/custom/hive/conf. They can also just type !connect in the prompt. Also, just a thought, but if the purity of beeline is paramount, you could maybe implement a feature where you give it some beeline-specific configuration file with something like: {noformat} extra.configs.loader=org.apache.HiveToBeelineConfigLoader {noformat} Which would allow beeline to have no native knowledge of Hive. Instead, it would have a generic config loading plugin mechanism that hive could leverage to make it load from hive-site.xml. Quite a bit of extra work to get the configs though, I know. > 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 > Attachments: beeline.conf.template > > > 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)