In PySpark 1.5.0, how do you list all items of column `y` based on the values of column `x`?
<p>The following question is specific to version 1.5.0 of PySpark, as new features are being constantly added to PySpark.</p>

<p>How do you list all items of column <code>y</code> based on the values of column <code>x</code>? 
For example:</p>

<pre><code>rdd = sc.parallelize([ {'x': "foo", 'y': 1}, 
                  {'x': "foo", 'y': 1}, 
                  {'x': "bar", 'y': 10}, 
                 {'x': "bar", 'y': 2},
                 {'x': 'qux', 'y':999}])
df = sqlCtx.createDataFrame(rdd)
df.show()

+---+---+
|  x|  y|
+---+---+
|foo|  1|
|foo|  1|
|bar| 10|
|bar|  2|
|qux|999|
+---+---+
</code></pre>

<p>I would like to have something like:</p>

<pre><code>+---+--------+
|  x|  y     |
+---+--------+
|foo| [1, 1] |
|bar| [10, 2]|
|bar| [999]  |
+---+--------+
</code></pre>

<p>The order doesn't matter. In Pandas, I can achieve this usign groupby:</p>

<pre><code>pd = df.toPandas()
pd.groupby('x')['y'].apply(list).reset_index()
</code></pre>

<p>However, <code>groupBy</code> aggregation functionality in ver 1.5.0 seems to be very limited. Any idea how to overcome this limitation?</p>