title: Spark: How to group and count RDD that meet certain condition?
body: <p>My <code>RDD</code>'s type is <code>RDD[Map]</code>, and the <code>map</code> format is like:</p>
  
  <pre><code>{"date": "2015-01-01", "topic": "sports", "content": "foo,bar"}
   ...
  </code></pre>
  
  <p>Now I would like to obtain a sequence like </p>
  
  <p><code>{"date": "2015-01-01", "topic":"sports", "count":22}</code></p>
  
  <p>that is, the count of every topic for each day.</p>
  
  <p>How to group and count it in <code>Spark</code>?</p>