使用hive -e'select'打印列标题时,是否可以阻止HIVE打印数据库? [英] Is it possible to stop HIVE from printing the database when printing column headers using hive -e 'select'?

查看:418
本文介绍了使用hive -e'select'打印列标题时,是否可以阻止HIVE打印数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表演时:

hive -e 'select * from database.table' > /localfilesystem/mytable.txt

列标题名称的格式为database.columnname,我希望它们仅是columnname.执行上述类型的查询时,是否有办法在列名中限制数据库?

the column header names are in the form database.columnname and I would like them to be columnname only. Is there a way to supress the database in the columnname when performing the above type of query?

推荐答案

hive.resultset.use.unique.column.names已在0.13中添加,默认为True.只需在~/.hiverchive-site.xml

hive.resultset.use.unique.column.names was added in 0.13 and defaults to True. Just set it to false in your ~/.hiverc or in hive-site.xml

 <property>
   <name>hive.resultset.use.unique.column.names</name>
   <value>false</value>
 </property> 

这篇关于使用hive -e'select'打印列标题时,是否可以阻止HIVE打印数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆