Harikrishnan Ck
Harikrishnan Ck

Reputation: 930

Hive tables meta details needed

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?

Upvotes: 1

Views: 1344

Answers (2)

K S Nidhin
K S Nidhin

Reputation: 2650

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 .

Upvotes: 1

Balaswamy Vaddeman
Balaswamy Vaddeman

Reputation: 8530

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"

Upvotes: 0

Related Questions