I have spark input dataframe like below.
Emp_ID Cricket Chess Swim
11 Y N N
12 Y Y Y
13 N N Y
Need Out Dataframe like below.
Hobbies Emp_id_list
Cricket 11,12
Chess 12
Swim 12,13
Any way to achieve this in efficient way in scala Spark would help ..
I have tried creating multiple dataframe(each for one hobby) and union of all 3. Need a efficient way.
New contributor
srinivas gowda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.