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>
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值