Aggregating multiple columns with custom function in Spark
<p>I was wondering if there is some way to specify a custom aggregation function for spark dataframes over multiple columns. </p>

<p>I have a table like this of the type (name, item, price):</p>

<pre><code>john | tomato | 1.99
john | carrot | 0.45
bill | apple  | 0.99
john | banana | 1.29
bill | taco   | 2.59
</code></pre>

<p>to:</p>

<p>I would like to aggregate the item and it's cost for each person into a list like this:</p>

<pre><code>john | (tomato, 1.99), (carrot, 0.45), (banana, 1.29)
bill | (apple, 0.99), (taco, 2.59)
</code></pre>

<p>Is this possible in dataframes? I recently learned about <code>collect_list</code> but it appears to only work for one column.</p>