This is what I am trying to do in Java but is not working as concat_ws requires Seq as the type of 2nd argument while collect_list return Column:
Dataset aggregatedDF = someDF
.groupBy("colA")
.agg(
concat_ws(",", collect_list(col("colB"))).as("comma_sep_col_b")
);
Same thing works in Scala:
val aggregatedDF = someDF
.groupBy("colA")
.agg(
concat_ws(",", collect_list($"colB")) as "comma_sep_col_b"
)