I have two RDDs, one `(a, b, a, c, b, c, a)` and the other - a paired RDD `((a, 0), (b, 1), (c, 2))`.

I want to replace the `a`s, `b`s and `c`s in first RDD with 0,1,2 (which are the values of keys a,b,c respectively in second RDD), respectively. I'd like to preserve the order of the events in first RDD.

How to achieve it in Spark?