显示表头和数据库信息

进入hive cli后 执行以下命令:

set hive.cli.print.header=true;

因为在cli中set配置属性只是当次有效,如果想永久配置的话,将上述命令配置到hive/conf下的配置文件中

##在hive-site.xml 中添加如下配置
vim /etc/hive/conf/hive-site.xml
###
  <property>
    <name>hive.cli.print.header</name>
    <value>true</value>
    <description>Whether to print the names of the columns in query output.</description>
  </property>
  <property>
    <name>hive.cli.print.current.db</name>
    <value>true</value>
    <description>Whether to include the current database in the Hive prompt.</description>
  </property>