Apache Hive: Display column names in the output of SELECT statement

If you’re executing any SELECT statement on Hive CLI, only the rows are displayed. The column names are not displayed by default. To show the column headers, print.header property needs to be set to true. This can be done with the following statement.

SET hive.cli.print.header=true;

By default, the output of SELECT statement will not have any column headers.

Now, let’s set the print.header to true and then try running the SELECT statement again. Notice the column headers (first_name and last_name).

Leave a Reply

Your email address will not be published. Required fields are marked *