records.groupBy(_.column1)
What if I want to include more columns like if I want to group by column1, column2 and column3?
Any hints?
Try
records.groupBy(record => (record.column1, record.column2, record.column3))
This will group by a tuple composed of those 3 columns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With