我有两个类似上图的字段。上述三行表示为同一图像中提到的单行。有人能让我知道如何产生以上结果在Hive不使用自定义项?
fdbelqdn1#
你可以用 concat_ws :
concat_ws
select concat_ws(',', collect_list(concat_ws(':', col1, col2))) as outputfrom mytable
select
concat_ws(',', collect_list(concat_ws(':', col1, col2))) as output
from mytable
1条答案
按热度按时间fdbelqdn1#
你可以用
concat_ws
: