I'm somewhat worried that all of these PairRDDFunctions functions have to be reimplemented here. It would be better for PairRDDFunctions to test whether the RDD it's built on has an index and execute differently in that case.