sparkbyexamples.com
Spark DataFrame Select First Row of Each Group?
In this Spark article, I've explained how to select/get the first row, min (minimum), max (maximum) of each group in DataFrame using Spark SQL window
Naveen Nelamali