Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hive - get column names

Tags:

hadoop

hive

Is it possible to retrieve column names from a table and load them into another table or a text file in hive? Please let me know if we can do this

like image 814
Vikash Talanki Avatar asked Sep 26 '13 21:09

Vikash Talanki


1 Answers

A bit more succinct version

hive -S -e "SHOW COLUMNS IN database_name.table_name" > column_names.txt
like image 196
Vikrant Goel Avatar answered Oct 08 '22 23:10

Vikrant Goel