Is there any way to identify which database the user is using while using the command line interface ?
To list out the databases in Hive warehouse, enter the command 'show databases'. The database creates in a default location of the Hive warehouse. In Cloudera, Hive database store in a /user/hive/warehouse.
current. db=true will show the current DB for current hive session only, but if we update the .
To know which database user in
hive> set hive.cli.print.current.db=true
or start hive with
hive --hiveconf hive.cli.print.current.db=true
then the prompt will display
hive (db_name)>
There are two ways to know the current database. One temporary in cli and second one is persistently.
1) in CLI just enter this command: set hive.cli.print.current.db=true;
2) In hive-site.xml paste this code:
<property> <name>hive.cli.print.current.db</name> <value>true</value> </property>
In second scenario, you can automatically display the Hive dabatabase name when you open terminal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With