title: Flatten Group By in Pyspark
body: <p>I have a pyspark dataframe. For example,</p>
  
  <pre><code>d= hiveContext.createDataFrame([("A", 1), ("B", 2), ("D", 3), ("D", 3),  ("A", 4), ("D", 3)],["Col1", "Col2"])
  
  +----+----+
  |Col1|Col2|
  +----+----+
  |   A|   1|
  |   B|   2|
  |   D|   3|
  |   D|   3|
  |   A|   4|
  |   D|   3|
  +----+----+
  </code></pre>
  
  <p>I want to group by <code>Col1</code> and then create a list of <code>Col2</code>. I need to flatten the groups. I do have a lot of columns.  </p>
  
  <pre><code>+----+----------+
  |Col1|      Col2|
  +----+----------+
  |   A|   [1,4]  |
  |   B|   [2]    |
  |   D|   [3,3,3]|
  +----+----------+
  </code></pre>