Is it possible to stop HIVE from printing the database when printing column headers using hive -e 'select'?

自古美人都是妖i 提交于 2020-03-19 06:40:11

问题


When performing:

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

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?


回答1:


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> 


来源:https://stackoverflow.com/questions/31705985/is-it-possible-to-stop-hive-from-printing-the-database-when-printing-column-head

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!