title: How to filter RDDs using count of keys in a map
body: <p>I have the following RDD</p>
  
  <pre><code>val reducedListOfCalls: RDD[(String, List[Row])]
  </code></pre>
  
  <p>The RDDs are:</p>
  
  <pre><code>[(923066800846, List[2016072211,1,923066800846])]
  
  [(923027659472, List[2016072211,1,92328880275]),
    923027659472, List[2016072211,1,92324440275])]
  
  [(923027659475, List[2016072211,1,92328880275]),
   (923027659475, List[2016072211,1,92324430275]),
   (923027659475, List[2016072211,1,92334340275])]
  </code></pre>
  
  <p>As shown above first RDD has 1 (key,value) pair, second has 2, and third has 3 pairs.</p>
  
  <p>I want to remove all RDDs that has less than 2 key-value pairs. The result RDD expected is: </p>
  
  <pre><code>[(923027659472, List[2016072211,1,92328880275]),
    923027659472, List[2016072211,1,92324440275])]
  
  [(923027659475, List[2016072211,1,92328880275]),
   (923027659475, List[2016072211,1,92324430275]),
   (923027659475, List[2016072211,1,92334340275])]
  </code></pre>
  
  <p>I have tried the following:</p>
  
  <pre><code>val reducedListOfCalls = listOfMappedCalls.filter(f =&gt; f._1.size &gt;1)
  </code></pre>
  
  <p>but it still given the original list only. The filter seems to have not made any difference. </p>
  
  <p>Is it possible to count the number of keys in a mapped RDD, and then filter based on the count of keys?</p>