title: How to get other columns when using Spark DataFrame groupby?
body: <p>when I use DataFrame groupby like this:</p>
  
  <pre><code>df.groupBy(df("age")).agg(Map("id"-&gt;"count"))
  </code></pre>
  
  <p>I will only get a DataFrame with columns "age" and "count(id)",but in df,there are many other columns like "name".</p>
  
  <p>In all,I want to get the result as in MySQL,</p>
  
  <blockquote>
    <p>"select name,age,count(id) from df group by age"</p>
  </blockquote>
  
  <p>What should I do when use groupby in Spark?</p>