Support Questions

Find answers, ask questions, and share your expertise

Get Database name within Hive UDF

New Contributor


Is there a way to get the database name in which a Hive UDF is deployed in? The reason I need this is because we use that as parameters to do different things in different databases.



Master Collaborator

If you are trying to determine the current database in your custom Hive UDF code, this should help

From beeline / hive cli you can check by running:

0: jdbc:hive2://localhost> select current_database();
|   _c0    |
| default  |
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.