title: Aggregate rows of Spark DataFrame to String after groupby
body: <p>I'm quite new both Spark and Scale and could really need a hint to solve my problem. So I have two DataFrames A (columns id and name) and B (columns id and text) would like to join them, group by id and combine all rows of text into a single String:  </p>
  
  <p>A</p>
  
  <pre><code>+--------+--------+
  |      id|    name|
  +--------+--------+
  |       0|       A|
  |       1|       B|
  +--------+--------+
  </code></pre>
  
  <p>B</p>
  
  <pre><code>+--------+ -------+
  |      id|    text|
  +--------+--------+
  |       0|     one|
  |       0|     two|
  |       1|   three|
  |       1|    four|
  +--------+--------+
  </code></pre>
  
  <p>desired result:</p>
  
  <pre><code>+--------+--------+----------+
  |      id|    name|     texts|
  +--------+--------+----------+
  |       0|       A|   one two|
  |       1|       B|three four|
  +--------+--------+----------+
  </code></pre>
  
  <p>So far I'm trying the following:</p>
  
  <pre><code>var C = A.join(B, "id")
  var D = C.groupBy("id", "name").agg(collect_list("text") as "texts")
  </code></pre>
  
  <p>This works quite well besides that my texts column is an Array of Strings instead of a String. I would appreciate some help very much.</p>