title: Get top values from a spark dataframe column in Scala
body: <pre><code>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")
  </code></pre>
  
  <p>I want to get top 3 values of col1. Can any please let me know the better way to do this.</p>
  
  <p>Spark : 1.6.2
  Scala : 2.10</p>