> On júl. 1, 2016, 5:19 du, Szehon Ho wrote:
> > beeline/src/java/org/apache/hive/beeline/BeeLineOpts.java, line 481
> > <https://reviews.apache.org/r/49498/diff/1/?file=1434738#file1434738line481>
> >
> >     It seems a hacky way to detect embedded mode.
> >     
> >     What do you think about doing an or, say if the command line opts is 
> > set, or the hive.cli.pring.current.db is in the properties file.  (i guess 
> > now there is beeline.properties)

To tell the truth, I did not know, that there were two modes of running 
beeline, until I found this type of check everywhere in the code, and finally 
found it where this was set. :) See HiveCli. I will think about your 
suggestions too, thanks


> On júl. 1, 2016, 5:19 du, Szehon Ho wrote:
> > beeline/src/java/org/apache/hive/beeline/ClientCommandHookFactory.java, 
> > line 64
> > <https://reviews.apache.org/r/49498/diff/1/?file=1434739#file1434739line64>
> >
> >     Just curious, did we explore an option to parse the database from the 
> > 'use' command on success to avoid the wasteful extra query, or was there 
> > some instances that it did not work as expected?

Actually we could parse the use, and the connect commands. The use parsing was 
already there, and I did the url parsing using the jdbc uri parsing util class, 
but for the go command we do not have anything at hand to use. So for keeping 
the code simple, I decided to use a single hook for every command. My reasoning 
behind it was, that this will run only after issuing one of the use, connrct, 
go commands and it is not prone to any dubious parsing, or other errors.

Thanks for the comments


- Peter


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


On júl. 1, 2016, 3:08 du, Peter Vary wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49498/
> -----------------------------------------------------------
> 
> (Updated júl. 1, 2016, 3:08 du)
> 
> 
> Review request for hive, Sergio Pena, Szehon Ho, and Vihang Karajgaonkar.
> 
> 
> Bugs: HIVE-14123
>     https://issues.apache.org/jira/browse/HIVE-14123
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> There are several jira issues complaining that, the Beeline does not respect 
> hive.cli.print.current.db.
> This is partially true, since in embedded mode, it uses the 
> hive.cli.print.current.db to change the prompt, since HIVE-10511.
> In remote mode, I think this function should use a beeline command line 
> option instead, like for the showHeader option emphasizing, that this is a 
> client side option.
> 
> The patch contains:
> - New configuration option
> - Changing the help text
> - Updating command hooks, to run in remote mode as well
> - Adding new hooks, for connect and go sqllite commands
> - Generalize database connection refresh command
> - Changing prompt
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java 66185f6 
>   beeline/src/java/org/apache/hive/beeline/BeeLineOpts.java 5aaa385 
>   beeline/src/java/org/apache/hive/beeline/ClientCommandHookFactory.java 
> c4d97bc 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 3a204c0 
>   beeline/src/java/org/apache/hive/beeline/ReflectiveCommandHandler.java 
> 3b863ae 
>   beeline/src/main/resources/BeeLine.properties 7500df9 
>   beeline/src/test/org/apache/hive/beeline/TestBeelineArgParsing.java ce1f538 
>   beeline/src/test/org/apache/hive/beeline/TestClientCommandHookFactory.java 
> c86de0a 
> 
> Diff: https://reviews.apache.org/r/49498/diff/
> 
> 
> Testing
> -------
> 
> Unit tests for the hooks, and the configuration option
> 
> Manual test in remote, and embedded mode
> 
> 
> Thanks,
> 
> Peter Vary
> 
>

Reply via email to