Hive tables meta details needed
Asked Answered
M

2

1
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?

Marguritemargy answered 28/10, 2013 at 11:2 Comment(0)
D
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 .

Deneb answered 28/10, 2013 at 14:38 Comment(0)
C
0

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"
Carboxylate answered 28/10, 2013 at 11:10 Comment(2)
Thanks Bala. BUt actually I want to extract the data in this order dbname,table name, column name.Marguritemargy
Hari,you know tablename.database name and column names can be get from above command,if you want only those details ,just grep them .Carboxylate

© 2022 - 2024 — McMap. All rights reserved.