Friday, 4 August 2017

5)How to retrieve the column names along with rows in HIVE CLI

Basically when we run the query in any RDBMS database , we get the column names along with rows, but that is not in the case for HIVE CLI.

To achive that, we need set the hive.cli.print.header property to true.

This can be done two ways:
1)Temporary solution:
    On the hive CLI prompt executing this command
       hive>set hive.cli.print.header=True


2)Permenant solution
    Adding this property in hive-site.xml file under $HIVE_HOME/conf folder
      <property>
           <name>hive.cli.print.header</name>
            <value>true</value>
            <description>Whether to print the names of the columns in query output</description>
       </property>


No comments:

Post a Comment

Fundamentals of Python programming

Fundamentals of Python programming: Following below are the fundamental constructs of Python programming: Python Data types Python...