Converting row values into a column array in spark dataframe
<p>I am working on spark dataframes and I need to do a group by of a column and convert the column values of grouped rows into an array of elements as new column.
Example :</p>

<pre><code>Input:

employee | Address
------------------
Micheal  |  NY
Micheal  |  NJ

Output:

employee | Address
------------------
Micheal  | (NY,NJ)
</code></pre>

<p>Any help is highly appreciated.!</p>