You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Vihang Karajgaonkar <vi...@cloudera.com> on 2016/09/02 06:30:51 UTC

Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/
-----------------------------------------------------------

Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.


Bugs: HIVE-14063
    https://issues.apache.org/jira/browse/HIVE-14063


Repository: hive-git


Description
-------

This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.

Properties in the user-specific configuration file override the properties derived from hive-site.xml.

Tested using newly added unit tests and itests in various Hiveserver2 configurations.


Diffs
-----

  beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
  beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
  beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/org/apache/hive/beeline/TestUserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 

Diff: https://reviews.apache.org/r/51593/diff/


Testing
-------


Thanks,

Vihang Karajgaonkar


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Vihang Karajgaonkar <vi...@cloudera.com>.

> On Sept. 2, 2016, 9:32 p.m., Gabor Szadovszky wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLine.java, line 932
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490492#file1490492line932>
> >
> >     Do we need this one to be public? Seems that is only used inside this class.
> >     Please, consider narrowing the visibility of the other new methods in this class.

Unfortunately, I cannot change some of the methods to private or default (package) visibility. The only two methods getDefaultHS2ConnectionFileParser and getHiveSiteHS2ConnectionFileParser need to be public for improving the test coverage. I tried to move them in another package and create a factory class to get the HS2ConnectionParsers, but hit the wall when I tried to mock static methods. The code was becoming convuluted and I thought it is best not to go further that route in the interest of code readability. I have annotated them @VisibleForTesting to document their increased visibility. Let me know if you have any better ideas.


> On Sept. 2, 2016, 9:32 p.m., Gabor Szadovszky wrote:
> > itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithHS2ConnectionFile.java, line 190
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490509#file1490509line190>
> >
> >     It seems that the last 3 methods have some common code. I would consider moving the common code parts to one place.

Modified existing method with added arguments so that other two can be get ridden of.


- Vihang


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review147678
-----------------------------------------------------------


On Sept. 6, 2016, 11:53 p.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2016, 11:53 p.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Gabor Szadovszky <ga...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review147678
-----------------------------------------------------------



Thanks for the patch.
Had some mostly minor findigs. Otherwise LGTM.


beeline/src/java/org/apache/hive/beeline/BeeLine.java (line 913)
<https://reviews.apache.org/r/51593/#comment214891>

    Do we need this one to be public? Seems that is only used inside this class.
    Please, consider narrowing the visibility of the other new methods in this class.



beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java (line 99)
<https://reviews.apache.org/r/51593/#comment214899>

    This check seems to be useless as the tokens are split on '=' and the result is properly checked in the next loop.



beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java (line 58)
<https://reviews.apache.org/r/51593/#comment214900>

    I would suggest putting the test classes into the same package so you can tighten the visibility to package private.



beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java (line 64)
<https://reviews.apache.org/r/51593/#comment214903>

    I would suggest putting the test classes into the same package so you can tighten the visibility to package private.



beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java (line 78)
<https://reviews.apache.org/r/51593/#comment214904>

    Contrary to the comment it returns an empty Properties object.
    It might worth to comment the return options in the interface.



beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java (line 91)
<https://reviews.apache.org/r/51593/#comment214906>

    I would use foreach and move the try-catch around it. It would be a bit more readable.



itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithHS2ConnectionFile.java (line 190)
<https://reviews.apache.org/r/51593/#comment214913>

    It seems that the last 3 methods have some common code. I would consider moving the common code parts to one place.



itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithHS2ConnectionFile.java (line 219)
<https://reviews.apache.org/r/51593/#comment214912>

    I guess, it was a debug output only...


- Gabor Szadovszky


On Sept. 2, 2016, 6:30 a.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 2, 2016, 6:30 a.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Vihang Karajgaonkar <vi...@cloudera.com>.

> On Sept. 2, 2016, 10:06 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLine.java, line 953
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490492#file1490492line953>
> >
> >     nit: missing space if (

fixed


> On Sept. 2, 2016, 10:06 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLine.java, line 960
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490492#file1490492line960>
> >
> >     What happens if there is not hive-site.xml on the classpath?

If the hive-site.xml is not a in the classpath, this method should return an empty properties object and only user specific configuration will be used. Thanks for pointing it out. I made some changes in getConnectionProperties in HiveSiteHS2ConnectionFileParser to address the same.


> On Sept. 2, 2016, 10:06 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java, line 42
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490497#file1490497line42>
> >
> >     Should not this be static?

fixed


> On Sept. 2, 2016, 10:06 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java, line 34
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490496#file1490496line34>
> >
> >     Should not we use constants here?

I think for the new ones keys which this features we can add them as constants in the interface so that anyone implementing them can use them. But for the other keys in the url, there are too many of them and it can increase over time. I don't think we should use constants for them.


> On Sept. 2, 2016, 10:06 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java, line 57
> > <https://reviews.apache.org/r/51593/diff/1/?file=1490497#file1490497line57>
> >
> >     It this is public, do we need the VisibleForTesting annotation?

fixed


- Vihang


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review147700
-----------------------------------------------------------


On Sept. 6, 2016, 11:53 p.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2016, 11:53 p.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Peter Vary <pv...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review147700
-----------------------------------------------------------



Thanks for the patch! This will be a really a usefull feature!

I did not have time to take a closer look on it.
What I have seen is nice, there is some nits, and questions (probably some of them is invalid - not finalized yet). Will have more time next week.


beeline/src/java/org/apache/hive/beeline/BeeLine.java (line 934)
<https://reviews.apache.org/r/51593/#comment214918>

    nit: missing space if (



beeline/src/java/org/apache/hive/beeline/BeeLine.java (line 941)
<https://reviews.apache.org/r/51593/#comment214917>

    What happens if there is not hive-site.xml on the classpath?



beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java (line 34)
<https://reviews.apache.org/r/51593/#comment214919>

    Should not we use constants here?



beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java (line 42)
<https://reviews.apache.org/r/51593/#comment214920>

    Should not this be static?



beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java (line 57)
<https://reviews.apache.org/r/51593/#comment214921>

    It this is public, do we need the VisibleForTesting annotation?


Thanks,
Peter

- Peter Vary


On Sept. 2, 2016, 6:30 a.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 2, 2016, 6:30 a.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connectionfile/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Vihang Karajgaonkar <vi...@cloudera.com>.

> On Sept. 7, 2016, 2:38 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java, line 88
> > <https://reviews.apache.org/r/51593/diff/2/?file=1492642#file1492642line88>
> >
> >     I might prefer not to expose the file location on the interface, if it is not absolutely required.
> >     
> >     What do you think of using instead of this a new public method:
> >     
> >     public boolean isConfigExists()?

Good idea. Added a new interface method configExists() instead of getFileLocation.


> On Sept. 7, 2016, 2:38 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLine.java, lines 981-982
> > <https://reviews.apache.org/r/51593/diff/2/?file=1492639#file1492639line981>
> >
> >     Public + VisibleForTesting

This is a marker annotation for documetation purposes only. The method needs to be more visible than required only for test coverage. I have added a comment saying the same


> On Sept. 7, 2016, 2:38 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLine.java, lines 976-977
> > <https://reviews.apache.org/r/51593/diff/2/?file=1492639#file1492639line976>
> >
> >     Public + VisibleForTesting

This is a marker annotation for documetation purposes only. The method needs to be more visible than required only for test coverage. I have added a comment saying the same


> On Sept. 7, 2016, 2:38 p.m., Peter Vary wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLine.java, lines 955-957
> > <https://reviews.apache.org/r/51593/diff/2/?file=1492639#file1492639line955>
> >
> >     I am not sure about this, and this is more like a requirement question, than a coding question:
> >     - We might like to use the hive-site.xml based connection data, even there is no user specific connection data.
> >     
> >     For example:
> >     - We have an unsecured cluster, so we do not mind, if everyone uses the same username, password using hive.
> >     
> >     This might be a valid usecase. We still can chose not to support this, since this is a bad practice :)
> >     
> >     So this is just a question, nothing more!

I had thought about this particular case. The issue is this change needs to be backwards compatible which means that previous methods of connecting using url should work. That means Beeline should know using some flag to use hive-site.xml or not. The presence of this file indicates that hive-site.xml is used or not. I had initially added an explicit flag for the same in user conf file, but seemed redundant to me. So if user would like to use only hive-site.xml for connection info, the can provide an empty file and it will serve as a flag to look for hive-site.xml. This may be true in a secure, kerberos enabled cluster where hive-site.xml has all the information that we need to connect. But there is a bug where beeline still asks for username, password even in kerberos enabled cluster, so currently, even in that case there needs to be some user-specific information which needs to be provided. I am planning to fix that case in a separate change. For all the other changes, there needs t
 o be a non-empty user-specific file which atleast provides user/password since hive-site.xml doesn't have that information.


- Vihang


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review148007
-----------------------------------------------------------


On Sept. 7, 2016, 6:22 p.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 7, 2016, 6:22 p.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Peter Vary <pv...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review148007
-----------------------------------------------------------



Hi Vihang,

Finally, I had time to read through the code.
One question about the requirements, and few smaller ones.

Otherwise LGTM.

Thanks,
Peter


beeline/src/java/org/apache/hive/beeline/BeeLine.java (lines 936 - 938)
<https://reviews.apache.org/r/51593/#comment215362>

    I am not sure about this, and this is more like a requirement question, than a coding question:
    - We might like to use the hive-site.xml based connection data, even there is no user specific connection data.
    
    For example:
    - We have an unsecured cluster, so we do not mind, if everyone uses the same username, password using hive.
    
    This might be a valid usecase. We still can chose not to support this, since this is a bad practice :)
    
    So this is just a question, nothing more!



beeline/src/java/org/apache/hive/beeline/BeeLine.java (lines 957 - 958)
<https://reviews.apache.org/r/51593/#comment215366>

    Public + VisibleForTesting



beeline/src/java/org/apache/hive/beeline/BeeLine.java (lines 962 - 963)
<https://reviews.apache.org/r/51593/#comment215367>

    Public + VisibleForTesting



beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java (line 88)
<https://reviews.apache.org/r/51593/#comment215364>

    I might prefer not to expose the file location on the interface, if it is not absolutely required.
    
    What do you think of using instead of this a new public method:
    
    public boolean isConfigExists()?


- Peter Vary


On Sept. 6, 2016, 11:53 p.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2016, 11:53 p.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Vihang Karajgaonkar <vi...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/
-----------------------------------------------------------

(Updated Sept. 30, 2016, 10:56 p.m.)


Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.


Changes
-------

Fixed HiveQA test failures and refactored some of the methods to improve readability


Bugs: HIVE-14063
    https://issues.apache.org/jira/browse/HIVE-14063


Repository: hive-git


Description
-------

This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.

Properties in the user-specific configuration file override the properties derived from hive-site.xml.

Tested using newly added unit tests and itests in various Hiveserver2 configurations.


Diffs (updated)
-----

  beeline/src/java/org/apache/hive/beeline/BeeLine.java 79922d267eaf13216e8a8e4826c050d334266579 
  beeline/src/java/org/apache/hive/beeline/Commands.java 039e3549209682b5ebdde937607b77c3ec094527 
  beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/org/apache/hive/beeline/TestBeeLineHistory.java e86197626a76474c189b683fa55f02959c7a8bff 
  beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 

Diff: https://reviews.apache.org/r/51593/diff/


Testing
-------


Thanks,

Vihang Karajgaonkar


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Peter Vary <pv...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review148335
-----------------------------------------------------------


Ship it!




LGTM (non binding)

- Peter Vary


On Sept. 7, 2016, 6:22 p.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 7, 2016, 6:22 p.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Vihang Karajgaonkar <vi...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/
-----------------------------------------------------------

(Updated Sept. 7, 2016, 6:22 p.m.)


Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.


Changes
-------

Added changes suggested by Peter.


Bugs: HIVE-14063
    https://issues.apache.org/jira/browse/HIVE-14063


Repository: hive-git


Description
-------

This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.

Properties in the user-specific configuration file override the properties derived from hive-site.xml.

Tested using newly added unit tests and itests in various Hiveserver2 configurations.


Diffs (updated)
-----

  beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
  beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
  beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 

Diff: https://reviews.apache.org/r/51593/diff/


Testing
-------


Thanks,

Vihang Karajgaonkar


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Gabor Szadovszky <ga...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/#review148013
-----------------------------------------------------------


Ship it!




LGTM

- Gabor Szadovszky


On Sept. 6, 2016, 11:53 p.m., Vihang Karajgaonkar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51593/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2016, 11:53 p.m.)
> 
> 
> Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.
> 
> 
> Bugs: HIVE-14063
>     https://issues.apache.org/jira/browse/HIVE-14063
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.
> 
> Properties in the user-specific configuration file override the properties derived from hive-site.xml.
> 
> Tested using newly added unit tests and itests in various Hiveserver2 configurations.
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
>   beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
>   beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51593/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vihang Karajgaonkar
> 
>


Re: Review Request 51593: HIVE-14063 : Add beeline connection configuration file to automatically connect to HS2 using beeline

Posted by Vihang Karajgaonkar <vi...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51593/
-----------------------------------------------------------

(Updated Sept. 6, 2016, 11:53 p.m.)


Review request for hive, Mohit Sabharwal, Sergio Pena, and Szehon Ho.


Changes
-------

Added the changes suggested.


Bugs: HIVE-14063
    https://issues.apache.org/jira/browse/HIVE-14063


Repository: hive-git


Description
-------

This change adds a new optional configuration file for Beeline. If this file is present at predefined locations, Beeline will attempt to create the connection url using the hive-site.xml found in classpath and another user-specific configuration file. Beeline then connects automatically using the url generated based on these configuration files. The main objective of the change is to provide user another way to connect to the HiveServer2 without providing the connection url everytime. The configuration file uses hadoop xml format so that we can support encryption/obfuscation using hadoop credential manager API in the future.

Properties in the user-specific configuration file override the properties derived from hive-site.xml.

Tested using newly added unit tests and itests in various Hiveserver2 configurations.


Diffs (updated)
-----

  beeline/src/java/org/apache/hive/beeline/BeeLine.java 8e65e3987398531cce5c65c383762cf49a52c578 
  beeline/src/java/org/apache/hive/beeline/Commands.java 2f3ec134098dfa3767bab9545438d1f38f11697c 
  beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/HiveSiteHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java PRE-CREATION 
  beeline/src/test/resources/hive-site.xml 5f310d68245275ac9dc24df45579784019eea332 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-http.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-nossl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-conn-conf-kerberos-ssl.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-config-noauth.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-multi-conf-list.xml PRE-CREATION 
  beeline/src/test/resources/test-hs2-connection-zookeeper-config.xml PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineConnectionUsingHiveSite.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithHS2ConnectionFile.java PRE-CREATION 
  itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/TestBeelineWithUserHs2ConnectionFile.java PRE-CREATION 

Diff: https://reviews.apache.org/r/51593/diff/


Testing
-------


Thanks,

Vihang Karajgaonkar