title: spark scala reducekey dataframe operation
body: <p>I'm trying to do a count in scala with dataframe. My data has 3 columns and I've already loaded the data and split by tab. So I want to do something like this:</p>
  
  <pre><code>val file = file.map(line=&gt;line.split("\t"))
  val x = file1.map(line=&gt;(line(0), line(2).toInt)).reduceByKey(_+_,1)
  </code></pre>
  
  <p>I want to put the data in dataframe, and having some trouble on the syntax</p>
  
  <pre><code>val file = file.map(line=&gt;line.split("\t")).toDF
  val file.groupby(line(0))
          .count()
  </code></pre>
  
  <p>Can someone help check if this is correct?</p>