val df = sc.parallelize(Seq((201601, a),
(201602, b),
(201603, c),
(201604, c),
(201607, c),
(201604, c),
(201608, c),
(201609, c),
(201605, b))).toDF("col1", "col2")
I want to get top 3 values of col1. Can any please let me know the better way to do this.
Spark : 1.6.2 Scala : 2.10
df.agg(max("col1"))If I do this I can get the max value.