title: RDD/Scala Get one column from RDD
body: <p>I have an <code>RDD[Log]</code> file with various fields (<code>username,content,date,bytes</code>) and I want to find different things for each field/column.</p>
  
  <p>For example, I want to get the min/max and average bytes found in the RDD. When i do:</p>
  
  <pre><code>val q1 = cleanRdd.filter(x =&gt; x.bytes != 0)
  </code></pre>
  
  <p>I get the full lines of the RDD with bytes != 0. But how can I actually sum them, calculate the avg, find the min/max etc? How can I take only one column from my RDD and apply transformations on it?</p>
  
  <p>EDIT: Prasad told me about changing the type to dataframe, he gave no instructions on how to do so though, and I cant find a solid answer on the site. Any help would be great.</p>
  
  <p>EDIT: LOG class:</p>
  
  <pre><code>case class Log (username: String, date: String, status: Int, content: Int)
  </code></pre>
  
  <p>using a cleanRdd.take(5).foreach(println) gives something like this</p>
  
  <pre><code>Log(199.72.81.55 ,01/Jul/1995:00:00:01 -0400,200,6245)
  Log(unicomp6.unicomp.net ,01/Jul/1995:00:00:06 -0400,200,3985)
  Log(199.120.110.21 ,01/Jul/1995:00:00:09 -0400,200,4085)
  Log(burger.letters.com ,01/Jul/1995:00:00:11 -0400,304,0)
  Log(199.120.110.21 ,01/Jul/1995:00:00:11 -0400,200,4179)
  </code></pre>