I have a DataFrame with 3 columns i.e. Id, First Name, Last Name
DataFrame
Id, First Name, Last Name
I want to apply GroupBy on the basis of Id and w
GroupBy
Id
You can aggregate multiple columns like this:
df.groupBy("id").agg(collect_list("fName"), collect_list("lName"))
It will give you the expected result.