Just get column names from hive table

If you simply want to see the column names this one line should provide it without changing any settings:

describe database.tablename;

However, if that doesn't work for your version of hive this code will provide it, but your default database will now be the database you are using:

use database;
describe tablename;

The solution is

show columns in table_name;

This is simpler than use

describe tablename;

Thanks a lot.


you could also do show columns in $table or see Hive, how do I retrieve all the database's tables columns for access to hive metadata

Tags:

Sql

Hadoop

Hive