Get the Connected User in Apache Hive

Apache Hive introduced a function named “current_user()” from version 1.2.0 which returns the current user name from the authenticator manager configured. It could be the same as the user provided when connecting, but it might be different for certain authentication managers (e.g. HadoopDefaultAuthenticator). 

Syntax: 
hive> current_user()

Apache Hive introduced a function named “logged_in_user()” from version 2.2.0 which returns the current user name from the session state. When connecting to Hive, this is the username provided.

Syntax:
hive> logged_in_user()

Hope you find this article helpful.

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s