I want to group by a given field and get the output with grouped fields. Below is an example of what I am trying to achieve:-
Imagine a table named \'sample_table\'
collect_set actually works as expected since a set as per definition is a collection of well defined and distinct objects i.e. objects occur exactly once or not at all within a set.