【问题标题】:how to read a complex type array<string> on impala or hive?如何在 impala 或 hive 上读取复杂类型数组<string>?
【发布时间】:2018-02-23 13:11:59
【问题描述】:

我尝试在 hive 上读取复杂类型

dog.owners (array<string>)

使用以下查询

select dog_id, concat_ws(',',collect_set(owners)) as owners 
from dog 
group by dog_id

但我收到以下错误

Argument 2 of function CONCAT_WS must be "string or array&lt;string&gt;", but "array&lt;array&lt;string&gt;&gt;" was found.

看起来数据类型不匹配。我尝试将列所有者创建为array&lt;array&lt;string&gt;&gt;,但我仍然遇到相同的错误。 有没有办法在 hive 或 impala 上阅读该专栏?

【问题讨论】:

  • 你想完成什么?样本数据和预期输出会有所帮助。
  • 你不需要collect_set

标签: hadoop hive parquet impala


【解决方案1】:
select dog_id, do.* from dog, dog.owners as do

【讨论】:

    猜你喜欢
    • 2019-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多