I have a dataframe read from csv file, and it's pretty much like a score table, and it has 4 columns
school_name class_name, student_name, score
What I want to do is group the school and class, and see the top 3 scores in each of the classes, and I'm trying it in this way
val df = spark.read.format("csv")
.option("sep", ",")
.option("inferSchema", "true")
.option("header", "true")
.load("students.csv")
df.groupBy("school_name", "class_name")....
And, I'm just stuck here.
Any advice?
EDIT It's not the top 3 scores but top 3 scores in each of the classes.