[SPARK-2534] Avoid pulling in the entire RDD in various operators

This should go into both master and branch-1.0.
I have to push back on the loss of the return type here, since I don't think it's obvious. I know it's kind of a pain to add the whole type specification, though... what would you think about putting a `: Iterator[JHashMap[K, V]]` after the final bracket?