HIVE 客户端打印表头配置
通过配置参数打印表头(当前会话有效)
① 不打印表头
set hive.cli.print.header=false;
② 打印表头,显示为 表名.字段名
set hive.cli.print.header=true;
③ 打印表头,只显示为 字段名
-- 该配置必须开启
set hive.cli.print.header=true;
set hive.resultset.use.unique.column.names=false;
通过配置参数打印数据库名(当前会话有效)
① 不显示数据库名
set hive.cli.print.current.db=false;
② 显示数据库名
set hive.cli.print.current.db=true;
通过配置文件配置(永久生效)
在 Hive
客户端的配置文件( 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.resultset.use.unique.column.names</name>
<value>false</value>
<description>
Make column names unique in the result set by qualifying column names with table alias if needed.
Table alias will be added to column names for queries of type "select *" or
if query explicitly uses table alias "select r1.x..".
</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>