Explore Courses Blog Tutorials Interview Questions
0 votes
in Big Data Hadoop & Spark by (11.4k points)

In Hive, when we do a query (like:  select * from employee), we do not get any column names in the output (like name, age, salary that we would get in RDBMS SQL), we only get the values.

Is there any way to get the column names to be displayed along with the output when you execute any query?

1 Answer

0 votes
by (32.3k points)
edited by

To see the names of the columns of the table in HiveQl, the following hive conf property should be set to true.

hive> set hive.cli.print.header=true;

And after setting the above Hive conf property to “true”, execute your Hive query to get your output along with the column name:

hive> select * from table_name;

For more information regarding Hive, refer to the following video:


Browse Categories