title: How do I groupby and concat a list in a Dataframe Spark Scala
body: <p>I have a dataframe with two columns with data as below </p>
  
  <pre><code>+----+-----------------+
  |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)|
  +----+-----------------+
  </code></pre>
  
  <p>And I need the result as below</p>
  
  <pre><code>+----+-----------------+
  |acct|           device|
  +----+-----------------+
  |   B|List(3, 4, 11, 9)|
  |   C|    List(3, 5, 6)|
  |   A|List(2, 6, 7, 10)|
  +----+-----------------+
  </code></pre>
  
  <p>I tried as below but ,it seems to be not working </p>
  
  <p><code>df.groupBy("acct").agg(concat("device"))</code></p>
  
  <p><code>df.groupBy("acct").agg(collect_set("device"))</code></p>
  
  <p>Please let me know how can I achieve this using Scala?</p>