I tried for grouping by value from raw key value pairs like
[(1, a), (2, a), (3, a), (4, a), (3, b), (1, b), (1, c), (4, c), (4, d)]
I'm able to group by key using groupByKey() method but I cant find way to group by value
a = [1 , 2 , 3 , 4]
b = [3, 1]
c = [1, 4]
d = [4]
I checked in spark API docs but couldnt find any methods