I have a dataframe with two columns with data as below
+----+-----------------+
|acct| device|
+----+-----------------+
| B| List(3, 4)|
| C| List(3, 5)|
| A| List(2, 6)|
| B|List(3, 11, 4, 9)|
| C| List(5, 6)|
| A|List(2, 10, 7, 6)|
+----+-----------------+
And I need the result as below
+----+-----------------+
|acct| device|
+----+-----------------+
| B|List(3, 4, 11, 9)|
| C| List(3, 5, 6)|
| A|List(2, 6, 7, 10)|
+----+-----------------+
I tried as below but ,it seems to be not working
df.groupBy("acct").agg(concat("device"))
df.groupBy("acct").agg(collect_set("device"))
Please let me know how can I achieve this using Scala?