Hive tables meta details needed

末鹿安然 提交于 2019-12-24 07:13:05

问题


select * from information_schema.columns;

In MySQL gives me the dbname, table name and column details of a MySQL db.

Can I get the same details in hive from any tables?


回答1:


If you have configured your metastore in mysql .Then there are tables in the metastore database named DBS, COLUMNS_V2 which will have metadata of all hive DBs and tables .




回答2:


Describe will meet your requirement.

   hive -e "desc formatted tablename"

On above output you can use grep like below

hive -e "desc formatted tablename" |grep -i database

only column names can be get with below command.

hive -e "show columns from tablename"


来源:https://stackoverflow.com/questions/19633000/hive-tables-meta-details-needed

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