What is the difference between static partitioning and dynamic partitioning in Hive?
January 12, 2022How to insert into a Hive table when the table has columns with complex types like Arrays?
January 26, 2022It is quite reasonable for Hive cli or Beeline users to want to see the database they are currently on and it’s frustrating that this is not the default option.
Hive cli
Set hive.cli.print.current.db to true if you are using Hive client.
Use below if you are already in the Hive client session.
hive> set hive.cli.print.current.db=true
Use below if you are starting a brand new Hive cli session
hive --hiveconf hive.cli.print.current.db=true
Here is how you will see the database name
hive (hirw_database)>
Beeline
Note that this option only works if you are using Beeline version 2.2.0 and above. Use showDbInPrompt when you are initiating a Beeline session.
beeline --showDbInPrompt=true