How to see the current database user is on with Hive cli or Beeline? - Big Data In Real World

How to see the current database user is on with Hive cli or Beeline?

What is the difference between static partitioning and dynamic partitioning in Hive?
January 12, 2022
How to insert into a Hive table when the table has columns with complex types like Arrays?
January 26, 2022
What is the difference between static partitioning and dynamic partitioning in Hive?
January 12, 2022
How to insert into a Hive table when the table has columns with complex types like Arrays?
January 26, 2022

It 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

 

Big Data In Real World
Big Data In Real World
We are a group of Big Data engineers who are passionate about Big Data and related Big Data technologies. We have designed, developed, deployed and maintained Big Data applications ranging from batch to real time streaming big data platforms. We have seen a wide range of real world big data problems, implemented some innovative and complex (or simple, depending on how you look at it) solutions.

Comments are closed.

How to see the current database user is on with Hive cli or Beeline?
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.

Hadoop In Real World is now Big Data In Real World!

X