Reputation: 23
I have two fields like above image.
The above three rows to be represented as single row as mentioned in same image.
Can someone let me know how to produce the above result in Hive without using UDF?
Upvotes: 0
Views: 23
Reputation: 42332
You can use concat_ws
:
select
concat_ws(',', collect_list(concat_ws(':', col1, col2))) as output
from mytable
Upvotes: 1