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

Peter Vary commented on HIVE-14123:
-----------------------------------

Original usage in compatibility mode, and CLI:
{noformat}
$ ./hive
Hive-on-MR is deprecated in Hive 2 and may not be available in the future 
versions. Consider using a different execution engine (i.e. spark, tez) or 
using Hive 1.X releases.
hive> set hive.cli.print.current.db=true;
hive (default)>
{noformat}

or

{noformat}
$ ./hive --hiveconf hive.cli.print.current.db=true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future 
versions. Consider using a different execution engine (i.e. spark, tez) or 
using Hive 1.X releases.
hive (default)> 
{noformat}

or in the configuration file like hive-site.xml

{noformat}
<property>
  <name>hive.cli.print.current.db</name>
  <value>true</value>
</property>
{noformat}

the result is:
{noformat}
$ ./hive
Hive-on-MR is deprecated in Hive 2 and may not be available in the future 
versions. Consider using a different execution engine (i.e. spark, tez) or 
using Hive 1.X releases.
hive (default)> 
{noformat}

The new usage possibilities in beeline mode:
{noformat}
$ ./beeline -u "jdbc:hive2:// a a" --showDbInPrompt=true
Connecting to jdbc:hive2://
Connected to: Apache Hive (version 2.2.0-SNAPSHOT)
Driver: Hive JDBC (version 2.2.0-SNAPSHOT)
Beeline version 2.2.0-SNAPSHOT by Apache Hive
0: jdbc:hive2:// (default)>
{noformat}

or in the ~/.beeline/beeline.properties on UNIX, or in 
HOME/beeline/beeline.properties on Windows
{noformat}
#Beeline version 2.2.0-SNAPSHOT by Apache Hive
#Tue Jul 19 17:09:49 CEST 2016
beeline.showdbinprompt=true
{noformat}

the result is:
{noformat}
$ ./beeline -u "jdbc:hive2:// a a"
Connecting to jdbc:hive2://
Connected to: Apache Hive (version 2.2.0-SNAPSHOT)
Driver: Hive JDBC (version 2.2.0-SNAPSHOT)
Beeline version 2.2.0-SNAPSHOT by Apache Hive
0: jdbc:hive2:// (default)> 
{noformat}

There is currently no possibility in beeline mode to change the configuration 
runtime.

> Add beeline configuration option to show database in the prompt
> ---------------------------------------------------------------
>
>                 Key: HIVE-14123
>                 URL: https://issues.apache.org/jira/browse/HIVE-14123
>             Project: Hive
>          Issue Type: Improvement
>          Components: Beeline, CLI
>    Affects Versions: 2.2.0
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Minor
>         Attachments: HIVE-14123.2.patch, HIVE-14123.3.patch, 
> HIVE-14123.4.patch, HIVE-14123.5.patch, HIVE-14123.6.patch, 
> HIVE-14123.7.patch, HIVE-14123.8.patch, HIVE-14123.9.patch, HIVE-14123.patch
>
>
> 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 beeline 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to