Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 424
invoketheshell Avatar asked Dec 25 '22 16:12

invoketheshell


1 Answers

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> 
like image 74
o-90 Avatar answered Apr 08 '23 18:04

o-90