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




beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineSiteParser.java
Lines 34-37 (patched)
<https://reviews.apache.org/r/66185/#comment280871>

    Can you update the this javadoc?



beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineSiteParser.java
Lines 79 (patched)
<https://reviews.apache.org/r/66185/#comment280874>

    Most of the code in this file is duplicated from 
UserHS2ConnectionFileParser. This logic would work for what you are trying to 
achieve but I think we are doing this in much more complex way than necessary. 
Here is my suggestion:
    
    Based on my understanding you have following requirements:
    1. User will provide a named url like eg blue using beeline -c blue
    2. If the user doesn't provide a named url a default url is used.
    
    You can do this with a small change in the existing code and without the 
need to merge the two connection files. In the example above, if the user 
doesn't specify -c option above but the beeline-hs2-connection.xml exists the 
code is same as what we have currently. (We can obviously support 
beeline-site.xml name as well with a trivial change)
    
    if the user specifies beeline -c blue instead, in 
UserHS2ConnectionFileParser.getConnectionProperties() instead of looking for 
keys starting for beeline.hs2.connection. you can modify the code to look for 
keys starting from beeline.hs2.connection.blue. In that case you reuse most of 
the existing code and don't need the additional merging logic. The result is 
you have only one user connection file and one hive-site.xml which can be 
overriden by user connection file.
    
    The only compromise in the above design is that you cannot provide one long 
url string like you want to do in beeline-site.xml. If this is not a hard 
requirement, I think we will have a much cleaner implementation with less 
confusion between having two connection xml files which behave almost the same 
way. If its a hard requirement, I guess you can still do by defining a new key 
like you are doing currently for beeline-site.xml
    
    Is there a use-case which will not work in my suggestion above? May be I am 
missing something very obvious. Would appreciate if you could help me 
undestand. Thanks!


- Vihang Karajgaonkar


On March 28, 2018, 8:27 p.m., Vaibhav Gumashta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66185/
> -----------------------------------------------------------
> 
> (Updated March 28, 2018, 8:27 p.m.)
> 
> 
> Review request for hive, Thejas Nair and Vihang Karajgaonkar.
> 
> 
> Bugs: HIVE-18963
>     https://issues.apache.org/jira/browse/HIVE-18963
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> https://issues.apache.org/jira/browse/HIVE-18963
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 402fadddde 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineConfFileParseException.java
>  PRE-CREATION 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineHS2ConnectionFileParseException.java
>  acddf82a67 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineSiteParseException.java
>  PRE-CREATION 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/BeelineSiteParser.java 
> PRE-CREATION 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileParser.java
>  b769e8581f 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java
>  f635b40633 
>   
> beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java
>  2801ebee09 
>   beeline/src/main/resources/BeeLine.properties 6fca953836 
>   
> beeline/src/test/org/apache/hive/beeline/hs2connection/TestUserHS2ConnectionFileParser.java
>  1d17887417 
>   beeline/src/test/resources/test-hs2-named-connection-config.xml 
> PRE-CREATION 
>   
> itests/hive-unit/src/test/java/org/apache/hive/beeline/hs2connection/BeelineWithHS2ConnectionFileTestBase.java
>  3da31ad8a9 
>   jdbc/src/java/org/apache/hive/jdbc/Utils.java 6d7787da7d 
> 
> 
> Diff: https://reviews.apache.org/r/66185/diff/2/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Vaibhav Gumashta
> 
>

Reply via email to