Is there any way to get the column name along with

2019-01-30 05:00发布

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?

7条回答
走好不送
2楼-- · 2019-01-30 05:37
1)Permenant solution
change 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>
2)Temporary solution:
go to hive prompt execute this comman
   hive>set hive.cli.print.header=True
查看更多
登录 后发表回答