I know that you can get column names from a table via the following trick in hive:
hive> set hive.cli.print.header=true; hive> select * from tablename
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
show columns in $table