The aggregator function collect_set can achieve what you are trying to get. Here is the documentation. Therefore, you can write a query like:
SELECT Col1, collect_set(Col2) FROM your_table GROUP BY Col1;
However, there is one striking difference between MySQL GROUP BY and Hive collect_set , while GROUP_CONCAT also stores duplicates in the resulting array, collect_set removes duplicates occurring in the array. In the example you showed, there are no duplicate group values ββfor Col2 , so you can use it and use it.
Neels source share