[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-11-21 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15683220#comment-15683220
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Hi [~leftylev],

I updated the HiveServer2 Clients wiki to include a section describing how to 
use this feature. Would appreciate if you could take a look and make any 
suggestions if needed. Thanks!

https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-Usinghive-site.xmltoautomaticallyconnecttoHiveServer2
 

> 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
>  Labels: TODOC2.2
> Fix For: 2.2.0
>
> Attachments: HIVE-14063.01.patch, HIVE-14063.02.patch
>
>
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-10-18 Thread Lefty Leverenz (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15584843#comment-15584843
 ] 

Lefty Leverenz commented on HIVE-14063:
---

Added a TODOC2.2 label.  Here's the doc link:

* [HiveServer2 Clients -- Beeline | 
https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients]

> 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
>  Labels: TODOC2.2
> Fix For: 2.2.0
>
> Attachments: HIVE-14063.01.patch, HIVE-14063.02.patch
>
>
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-10-05 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15550067#comment-15550067
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Thanks for the review [~aihuaxu]. [~szehon] [~spena] Would you like to review 
too? Let us know if you would like us to wait for your review. 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
> Attachments: HIVE-14063.01.patch, HIVE-14063.02.patch, 
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-10-05 Thread Aihua Xu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15549045#comment-15549045
 ] 

Aihua Xu commented on HIVE-14063:
-

+1. The patch looks good to me.

> 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: HIVE-14063.01.patch, HIVE-14063.02.patch, 
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-10-03 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15542865#comment-15542865
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Hi [~aihuaxu] I fixed the test failures and updated the review. Can you please 
review?

> 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: HIVE-14063.01.patch, HIVE-14063.02.patch, 
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-10-01 Thread Hive QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15538150#comment-15538150
 ] 

Hive QA commented on HIVE-14063:




Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12831194/HIVE-14063.02.patch

{color:green}SUCCESS:{color} +1 due to 5 test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 6 failed/errored test(s), 10671 tests 
executed
*Failed tests:*
{noformat}
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[acid_mapjoin]
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[ctas]
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[vector_join_part_col_char]
org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainuser_3]
org.apache.hadoop.hive.metastore.TestMetaStoreMetrics.testMetaDataCounts
org.apache.hive.jdbc.TestJdbcWithMiniHS2.testAddJarConstructorUnCaching
{noformat}

Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/1368/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/1368/console
Test logs: 
http://ec2-204-236-174-241.us-west-1.compute.amazonaws.com/logs/PreCommit-HIVE-Build-1368/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 6 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12831194 - PreCommit-HIVE-Build

> 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: HIVE-14063.01.patch, HIVE-14063.02.patch, 
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-09-14 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15492025#comment-15492025
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


There were test failures for beeline in the last week due to a unrelated 
regression. The tests are fixed now. I will upload the patch again to trigger 
the test run again.

> 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: HIVE-14063.01.patch, 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-09-14 Thread Aihua Xu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15490648#comment-15490648
 ] 

Aihua Xu commented on HIVE-14063:
-

[~vihangk1] Are those failed unit tests related? Do you know why TestBeeline 
and TestHiveCli tests didn't finish?

> 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: HIVE-14063.01.patch, 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-09-02 Thread Hive QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15460193#comment-15460193
 ] 

Hive QA commented on HIVE-14063:




Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12826778/HIVE-14063.01.patch

{color:green}SUCCESS:{color} +1 due to 4 test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 7 failed/errored test(s), 10462 tests 
executed
*Failed tests:*
{noformat}
TestBeeLineWithArgs - did not produce a TEST-*.xml file
TestBeelineWithHS2ConnectionFile - did not produce a TEST-*.xml file
TestHiveCli - did not produce a TEST-*.xml file
org.apache.hadoop.hive.cli.TestCliDriver.org.apache.hadoop.hive.cli.TestCliDriver
org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[vector_join_part_col_char]
org.apache.hadoop.hive.cli.TestMiniLlapCliDriver.testCliDriver[acid_bucket_pruning]
org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainuser_3]
{noformat}

Test results: 
https://builds.apache.org/job/PreCommit-HIVE-MASTER-Build/1086/testReport
Console output: 
https://builds.apache.org/job/PreCommit-HIVE-MASTER-Build/1086/console
Test logs: 
http://ec2-204-236-174-241.us-west-1.compute.amazonaws.com/logs/PreCommit-HIVE-MASTER-Build-1086/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 7 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12826778 - PreCommit-HIVE-MASTER-Build

> 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: HIVE-14063.01.patch, 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-08-10 Thread Darren Lo (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-08-10 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15415977#comment-15415977
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


It is a good suggestion to include these values in hive-site.xml with the 
advantages of leveraging existing configuration frameworks to deliver the 
configs to Beeline. But IMO there are the following problems with using 
hive-site.xml

1. Beeline is in theory a general purpose JDBC client. As far as I understand 
it was not designed to be hive-only client. Adding these values to 
hive-site.xml is essentially tying this feature to hive specific environments. 
While one may argue that Beeline is almost always used for Hive, that is 
something that the larger community in general has to decide to whether to 
treat it as hive-specific JDBC client or not.

2. Different users could potentially have different connection endpoints like 
urls, credentials (even authentication mechanisms for different HS2 instances?) 
which means we need to store the user-specific information in some other place 
(environment variables/configuration file) I don't see any particular 
advantages of using two sources of information for getting a few configuration 
values since we will have to read both the files in any case. Similarly, user 
specific configurations like hive variables and hiveConf need to be separated 
from the the all-purpose general hive-site.xml. All this file will contain is 
the user-friendly way to describe connection url (which includes hosts, 
authentication, default db, hivevars and user-specific hiveConf)

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-08-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15415393#comment-15415393
 ] 

Sergio Peña commented on HIVE-14063:


Sounds good idea to keep the configs on hive-site.xml just to follow the 
standard. However, we also want that users can have their own credentials in a 
place where Hive can look for them, like ~/.hive/hive-site.xml or any other 
place. 

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-08-09 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15414639#comment-15414639
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


I had a offline discussion with [~dlo]. Copying his comment here for the record.

{quote}
Why is it a problem for there to be more properties in hive-site.xml than you 
need? Can't you just add what you need to hive-site.xml? Today, hive-site.xml 
already serves different use-cases that use different subsets of properties, 
such as the old hive CLI, HS2, and the Hive Metastore Server. It's not a 
problem that there are HS2-specific properties in that file. 

The most logical place for these configs is to add them to hive-site.xml - the 
existing standard client config file for hive. I'm sure some users are going to 
put configs into hive-site.xml and be confused when they have to actually go 
into this new config file.

When you say a "properties file", you mean it'll be like a java properties 
file, and NOT a Hadoop XML file? I strongly recommend against this. Hadoop XML 
is the standard config format, and using something else means you can't 
leverage standard Hadoop libraries like the Hadoop credential provider.
{quote}

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-07-28 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15398129#comment-15398129
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Thanks [~ngangam] for your suggestions.

I agree that the file location should be user specific which would enable 
multiple users to have different connection information. I will incorporate 
that into the change. Also, I like the file name 
default-hs2-connection.properties. 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
> 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-07-27 Thread Naveen Gangam (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15396329#comment-15396329
 ] 

Naveen Gangam commented on HIVE-14063:
--

[~vihangk1] This will be useful as user move from CLI to beeline and looking 
for similar user experience. Thanks for putting this together.

I have a couple of comments
1) I think it will be more useful to make the default properties file be 
specific to a user and should be someplace under the ${user.home} aka user's 
home directory (quick suggestion ~/.beeline/whateverfilename.properties) . This 
prevents users having to overwrite each other's files and allows them to run 
their jobs simultaneously across different HS2 instances. It is very realistic 
to have users from different projects using a shared cluster be assigned to 
different HS2 instance.
2) Having the password in this file is a big concern of mine too. However, it 
is always a good practice on the user's behalf to take away read permissions to 
any files that might contain passwords. In lieu of #1, it allows users to 
control file permissions to the file thats owned by them (in their home 
directories). So if we choose to support passwords in the future, there will be 
no changes to the file location.
3) Minor point, since there has been a couple of comments on what the file name 
should be, though I would offer my thoughts. Since the file really contains 
connection properties for HS2, (and because beeline.properties is already 
taken), perhaps something like default-hiveserver.properties or 
hiveserver-connection.properties or default-hs2-connection.properties or 
something alike?


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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-07-12 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15373903#comment-15373903
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Adding password to the file could be a security risk. So we should not support 
password with this configuration file. In case of Kerberos environment, the 
file could provide the principal. In case of LDAP environment, the password 
should be prompted to the user when connection is initiated. In default mode of 
none, an empty password should suffice to connect to the hs2 (so we can skip 
the password prompt for that mode too)

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-30 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15357656#comment-15357656
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Thanks [~szehon] for your comment. I have attached first draft version of the 
how the conf file may look like. We can add more documentation of each 
parameter in the template file so that users can understand when each parameter 
is used. A template file called beeline.conf.template can be provided in the 
conf directory and user can use it as a template to create the beeline.conf at 
pre-defined set of locations (need to be determined)

beeline.properties file is used to store the properties which include 
lastConnectedUrl when the user issues a !save command from beeline command 
line. Once it is saved the user can issue !reconnect to reconnect to the last 
connected url. Another way to use default urls is to provide environment 
variables starting with BEELINE_URL_ and then issue beeline connect -u 
. Key point being user needs to either issue !reconnect or ./beeline 
connect -u id command. The objective of providing a default conf file is to 
provide seemless experience to the user so that he/she can connect directly by 
issuing ./beeline (just like hiveCli)

Both these methods are orthogonal so that they both can be independently used 
without affecting each other. User can choose one way or the other based on 
their preference. 

They can co-exist together too such that beeline.properties should take 
precedence over beeline.conf file. The reason being user explicitly issues 
!save command with the intention to reuse it by issuing !reconnect command. Eg. 
if the user gets auto-connected using the beeline.conf file, and issues !save 
it will create a ~/.beeline/beeline.properties and it will be used as long user 
fires the !reconnect command. In such case the design should detect that 
beeline.properties exists and it should not use the default conf file. Since 
the user explicitly issued !save command earlier, as long as 
~/.beeline/beeline.properties exists, that file will be used and user can 
either issue !reconnect or the complete !connect -u .. url. If however, 
beeline.properties does not exist, and beeline.conf exists, beeline will 
attempt to initiate connection using the conf file. If none of the files are 
present current behavior will continue.

[~spena] [~mohitsabharwal] [~sircodesalot] [~lskuff] please review and let us 
know your thoughts. Feel free to include anyone who might be interested. 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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-29 Thread Szehon Ho (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15355658#comment-15355658
 ] 

Szehon Ho commented on HIVE-14063:
--

Cool.  I wonder to clarify, can we see what this conf file will look like?  And 
what is the relationship with the newly-added beeline.properties.  What kind of 
things go where, and the interaction between the two, if both are present and 
if there are same properties defined in both?

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-29 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15355571#comment-15355571
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


I confirmed that the above approach works fine in a Kerberos enabled cluster 
with HAproxy for load-balancing too. Using Zookeeper for load-balancing 
shouldn't be a problem too as long the url is has all the information.

In HiveConnection.java

{code:java}
try {
  connParams = Utils.parseURL(uri);
} catch (ZooKeeperHiveClientException e) {
  throw new SQLException(e);
}
{code}

The Utils.parseURL method above parses the url string including zookeeper 
ensemble and service discovery mode. As long as the url contains all the right 
information the code path should be the same.

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-23 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15347422#comment-15347422
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


Thanks [~szehon] for your inputs.
{quote}
One usability issue is that those beeline properties are defined by just a 
letter like 'u', 'n', 'p'. Hence it would be confusing in the properties file 
if the key is different, maybe its better if beeline itself took more 
descriptive names in addition to letters to make it consistent.
{quote}

I am planning to use descriptive arguments instead of single letter like 'url', 
'user', 'password' for 'u', 'n' and 'p' respectively. That way we remain 
consistent with the existing documentation and the keys are user-friendly too.

{quote}
A lot of times there is more than one HS2 in a cluster, like HA Proxy or ZK 
quorum load balancing. I assume the proposal also allows for connecting to 
those URL's as well, to get a random HS2? And also for kerberos as well?
{quote}

Thanks for pointing this out. I have investigated the Kerberos environment 
use-case and it should work fine with the approach above. I am still testing it 
though. I will update if I find it otherwise. Regarding ZK quorum or HA proxy 
based load balancing, I will need to investigate more. I will let you know.

{quote}
And one question to think about is , if you override 'url' from the command 
line, will beeline prompt you for new username, password, as its a new HS2 HA 
group/instance.
{quote}

If the user overrides using command line like eg. !connect, the behavior should 
remain same as existing. Beeline will not look for a default properties file. 
Please let me know if I misunderstood your question. Thanks.

{quote}
Also, what about renaming the file to be something like 'hive.cnf', or 
'hive.conf', or 'beeline.cnf', or other different than .properties? properties 
sounds more like a Java properties file than a Hive configuration file.
{quote}
I think we should use beeline.cnf or beeline.conf in that case. hive.conf or 
hive.cnf could be confused with HiveCli. Its better to have beeline in the file 
name so that users will not get confused about the purpose of the file. 
[~spena] Let me know what do you think?

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-23 Thread Szehon Ho (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15346801#comment-15346801
 ] 

Szehon Ho commented on HIVE-14063:
--

Re property-file good to know.  Would be great to document that on the wiki, as 
it was not mentioned.

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-23 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15346597#comment-15346597
 ] 

Sergio Peña commented on HIVE-14063:


[~szehon] The --property-file parameter already exists on beeline. I think 
Vihang was saying that users can still use such property to pass the same 
properties file we will fix here.

I was thinking that we could also add more default locations besides HIVE_CONF, 
such as $HOME/.hive? This way users can have its own file with url and password 
instead of a general available only on HIVE_CONF. 

Also, what about renaming the file to be something like 'hive.cnf', or 
'hive.conf', or 'beeline.cnf', or other different than .properties? properties 
sounds more like a Java properties file than a Hive configuration file. We can 
use this configuration file for future features too.

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-22 Thread Szehon Ho (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15345408#comment-15345408
 ] 

Szehon Ho commented on HIVE-14063:
--

And one question to think about is , if you override 'url' from the command 
line, will beeline prompt you for new username, password, as its a new HS2  HA 
group/instance.

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-22 Thread Szehon Ho (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15345404#comment-15345404
 ] 

Szehon Ho commented on HIVE-14063:
--

I think it will be very useful, to have a properties file to allow for auto 
specification of properties like url, name, password.  I assume that's the 
properties that are proposed, or is there more?  Another idea is to detect a 
local HS2 and connect to that, but it would be orthogonal.

Some thoughts on this proposal:

I'm not sure about the need for a --property-file if user can override some 
properties via the command line.

A lot of times there is more than one HS2 in a cluster, like HA Proxy or ZK 
quorum load balancing.  I assume the proposal also allows for connecting to 
those URL's as well, to get a random HS2?  And also for kerberos as well?

One usability issue is that those beeline properties are defined by just a 
letter like 'u', 'n', 'p'.   Hence it would be confusing in the properties file 
if the key is different, maybe its better if beeline itself took more 
descriptive names in addition to letters to make it consistent.


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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-22 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15344884#comment-15344884
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


[~szehon] Can you please take a look and comment what you think about this? 
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)


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-21 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15342487#comment-15342487
 ] 

Vihang Karajgaonkar commented on HIVE-14063:


I think beeline.properties should ideally be the right name for this but since 
we already have a BeeLine.properties file which is used by beeline 
ResourceBundle it causes exceptions like below if we have beeline.properties

{code}
java.util.MissingResourceException: Can't find resource for bundle 
java.util.PropertyResourceBundle, key help-addlocaldrivername
at java.util.ResourceBundle.getObject(ResourceBundle.java:395)
at java.util.ResourceBundle.getString(ResourceBundle.java:355)
at org.apache.hive.beeline.BeeLine.loc(BeeLine.java:470)
at org.apache.hive.beeline.BeeLine.loc(BeeLine.java:447)
at 
org.apache.hive.beeline.ReflectiveCommandHandler.(ReflectiveCommandHandler.java:45)
at org.apache.hive.beeline.BeeLine.(BeeLine.java:176)
at org.apache.hive.beeline.BeeLine.(BeeLine.java:519)
at 
org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:509)
at org.apache.hive.beeline.BeeLine.main(BeeLine.java:493)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
{code}


Hence the other good name for this file could be beeline.conf instead of 
beeline-default.properties.

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


[jira] [Commented] (HIVE-14063) beeline to auto connect to the HiveServer2

2016-06-21 Thread Vihang Karajgaonkar (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-14063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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  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)