I am working on spark dataframes and I need to do a group by of a column employee , designation and company and convert the column values of grouped rows into an array of elements as new column. Example :
Input:
employee | Company Address | designation | company | Home Adress
--------------------------------------------------
Micheal | NY | Head | xyz | YN
Micheal | NJ | Head | xyz | YM
Output:
employee | designation | company | Address
--------------------------------------------------
Micheal | Head | xyz | [Company Address : NY , Home Adress YN], [Company Address : NJ , Home Adress : Ym]
Any help is highly appreciated.!