impala 中的乘法行
我正在通过 sqoop 从带有一些连接表的视图中获取一些数据到 impala 的外部表中。但是我看到一个表中的列乘以行。 例如
id first_name surname step name value
1 ted kast 1 museum visitor
1 ted kast 1 shop buyer
1 ted kast 2 museum visitor
1 ted kast 2 shop buyer
,但我想成为这样的人,
id first_name surname step name_value
1 ted kast 1 [(museum visitor), (shop buyer)]
1 ted kast 2 [(museum visitor), (shop buyer)]
我怎样才能在黑斑羚中实现这一目标?
I am fetching some data from a view with some joined tables through sqoop into an external table in impala. However I saw that the columns from one table multiply the rows.
For example
id first_name surname step name value
1 ted kast 1 museum visitor
1 ted kast 1 shop buyer
1 ted kast 2 museum visitor
1 ted kast 2 shop buyer
But I want to be something like that
id first_name surname step name_value
1 ted kast 1 [(museum visitor), (shop buyer)]
1 ted kast 2 [(museum visitor), (shop buyer)]
How can I achieve that in impala?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们可以在此处将聚合与
GROUP_CONCAT
一起使用:这是一个 MySQL 的 demo,其语法与 Impala 几乎相同。
We can use aggregation here along with
GROUP_CONCAT
:Here is a demo for MySQL, where the syntax is almost the same as for Impala.