What is the difference between partitioning and bucketing a table in Hive?
September 20, 2021Why do I see 200 tasks in Spark execution?
September 24, 2021Sometimes you would have a need to list all the columns in a table. You can do this pretty easily if you are using a RDBMS like Oracle or SQL Server using Toad or SQL Management Studio respectively. There are a couple of ways to list all the columns in a Hive table.
Solution
You can do describe formatted on a table to get all the information about the table and it will look like below. The problem is it will list all the details behind the table along with the column names.
If you need just the column names, you can execute show columns in <table name>
0: jdbc:hive2://ms2.hirw.com:2181,wk1.hirw.co> show columns in employee; +---------+--+ | field | +---------+--+ | eid | | name | | salary | +---------+--+ 3 rows selected (0.297 seconds)