title: How to do opposite of explode in PySpark?
body: <p>Let's say I have a <code>DataFrame</code> with a column for users and another column for words they've written:</p>
  
  <pre class="lang-python prettyprint-override"><code>Row(user='Bob', word='hello')
  Row(user='Bob', word='world')
  Row(user='Mary', word='Have')
  Row(user='Mary', word='a')
  Row(user='Mary', word='nice')
  Row(user='Mary', word='day')
  </code></pre>
  
  <p>I would like to aggregate the <code>word</code> column into a vector:</p>
  
  <pre class="lang-python prettyprint-override"><code>Row(user='Bob', words=['hello','world'])
  Row(user='Mary', words=['Have','a','nice','day'])
  </code></pre>
  
  <p>It seems I can't use any of Sparks grouping functions because they expect a subsequent aggregation step. My use case is that I want to feed these data into <code>Word2Vec</code> not use other Spark aggregations.</p>