I have a RDD like this:
rdd = sc.parallelize(['a','b','a','c','d','b','e'])
I want to create a map(dictionary) of each unique value to an index.
The output will be a map (key, value) like:
{'a':0, 'b':1, 'c':2,'d':3,'e':4}
It's super easy to do in Python but I don't know how to do this in Spark.