Created on 04-05-2017 10:34 AM - edited 09-16-2022 04:24 AM
Hello,
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.
Thanks
Created 04-07-2017 01:10 AM
If you are trying to determine the current database in your custom Hive UDF code, this should help
https://github.com/apache/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/UDFCurr...
From beeline / hive cli you can check by running:
0: jdbc:hive2://localhost> select current_database(); +----------+--+ | _c0 | +----------+--+ | default | +----------+--