I have a Spark dataframe parsed from an XML file which has data in the below format:
+---------+------------------------------------------------------------------------------------------+----------------------------+------------------------------------------------+
|id |a |b |c |
+---------+------------------------------------------------------------------------------------------+----------------------------+------------------------------------------------+
|191683250|[52396062, 55064266, 51149167, 53441347, 51309543, 51517728, 51543627, 68138995, 70180065]|[2, 2, 1, 3, 3, 2, 2, 27, 1]|[1.15, 0.8, 4.0, 2.49, 1.0, 2.8, 0.4, 0.49, 2.0]|
+---------+------------------------------------------------------------------------------------------+----------------------------+------------------------------------------------+
I need the output data in the format:
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|id |a |
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|191683250|Array[(52396062,2,1.5), (55064266,2,0.8), (51149167,1,4.0), (53441347,3,2.49), (51309543,3,1.0), (51517728,2,2.8), (51543627,2,0.4), (68138995,27,0.49), (70180065,1,2.0)]|
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
ie., I need an Array of StructTypes/tuples. Im just stuck on how to proceed on this.
Could you please point me how can I achieve this in Spark using Scala. Appreciate any help.