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