Is it possible in Spark to implement '.combinations' function from scala collections?

/** Iterates over combinations.

*

* @return An Iterator which traverses the possible n-element combinations of this $coll.

* @example `"abbbc".combinations(2) = Iterator(ab, ac, bb, bc)`

*/

For example how can I get from RDD[X] to RDD[List[X]] or RDD[(X,X)] for combinations of size = 2. And lets assume that all values in RDD are unique.