How to list all hive databases being in use or created so far?

孤街浪徒 提交于 2019-12-05 09:55:12

问题


Similar to SHOW TABLES command, do we have any such command to list all databases created so far?


回答1:


This page mentions the command SHOW DATABASES.

From the manual:

SHOW (DATABASES|SCHEMAS) [LIKE identifier_with_wildcards];

SHOW DATABASES lists all of the databases defined in the metastore. The optional LIKE clause allows the list of databases to be filtered using a regular expression. Wildcards in the regular expression can only be '' for any character(s) or '|' for a choice. Examples are 'employees', 'emp', 'emp*|*ees', all of which will match the database named 'employees'.




回答2:


show databases;

The above query will list all the databases available in the hive metastore.




回答3:


For any such queries involving metadata of the objects, you must use the hive metastore deployed on databases such as MySQL or likes of MySQL. You can use the hive database installed on metastore and use the INFORMATION_SCHEMA views/tables for your queries



来源:https://stackoverflow.com/questions/19781965/how-to-list-all-hive-databases-being-in-use-or-created-so-far

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!