进入hive cli后 执行以下命令:
set hive.cli.print.header=true;
因为在cli中set配置属性只是当次有效,如果想永久配置的话,将上述命令配置到hive/conf下的配置文件中
##在hive-site.xml 中添加如下配置 vim /etc/hive/conf/hive-site.xml ###hive.cli.print.header true Whether to print the names of the columns in query output. hive.cli.print.current.db true Whether to include the current database in the Hive prompt.



