Created 08-23-2017 04:21 PM
When using HiveCLI, if we
SET hive.cli.print.current.db = true;
Then the command prompt for Hive CLI displays the current database name until the end of the session as shown below:
hive mydb >
I tried using the same property in Beeline but had no effect. Is there a different way of achieving this in Beeline ?
Created 08-23-2017 04:24 PM
I did not try the following myswlf but looks promising:
In BeeLine in beeline mode use the --showDbInPrompt command line option instead.
As per: https://issues.apache.org/jira/browse/HIVE-13899
.
As per: https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients
--showDbInPrompt=[true/false] : Display the current database name in prompt. Default is false.
Usage: beeline --showDbInPrompt=true
Created 08-23-2017 04:24 PM
I did not try the following myswlf but looks promising:
In BeeLine in beeline mode use the --showDbInPrompt command line option instead.
As per: https://issues.apache.org/jira/browse/HIVE-13899
.
As per: https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients
--showDbInPrompt=[true/false] : Display the current database name in prompt. Default is false.
Usage: beeline --showDbInPrompt=true
Created 08-23-2017 04:57 PM
@Jay SenSharma - Thank you for prompt response.
I see this only works for Beeline version 2.3.0 and latest.
I am currently using 1.2.1 and thus this will have no effect. However, I appreciate your help. I will try for a workaround for version 1.2.1, if nothing else works I will upgrade to 2.3.0 and accept your answer.
Created 08-24-2017 08:31 AM
Thank you. Yes, this flag is added later in beeline "--showDbInPrompt", Before that ( HIVE-14123 , fixed in 2.3.0) there was not option to display the database name.
Created 09-23-2019 07:59 PM
yes, this works
beeline --showDbInPrompt=true -u "jdbc:hive2://...."
Thanks
Created 09-23-2019 08:01 PM
and I see, yes, i am using 2.3.3
Created 09-24-2019 12:02 AM
Thank you very much!