【问题标题】:Is it possible to stop HIVE from printing the database when printing column headers using hive -e 'select'?使用 hive -e 'select' 打印列标题时是否可以阻止 HIVE 打印数据库?
【发布时间】:2015-07-30 23:43:43
【问题描述】:

表演时:

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

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

【问题讨论】:

  • 你试过hive -e 'USE database; select * from table' > ...。我对这个问题有点困惑,据我所知,标题中的列名是tablename.columnname。可能您使用的是不同版本的 hive。
  • 我们使用的是 hive 0.08,我们得到的只是在没有数据库的情况下调用 name。然后我们移动到 0.13。现在数据库在列的名称中

标签: hadoop hive hiveql


【解决方案1】:

hive.resultset.use.unique.column.names 是在 0.13 中添加的,默认为 True。只需在 ~/.hiverchive-site.xml 中将其设置为 false

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多