title: Spark scala dataframe finding max
body: <p>I am using following to find the max column value.</p>
  
  <pre><code>  val d = sqlContext.sql("select max(date), id from myTable group By id")
  </code></pre>
  
  <p>How to do the same query on DataFrame without registering temp table.</p>
  
  <p>thanks,</p>