I am newbie in Spark. I trying to achieve below use case using scala.

```
-DataFrame 1

| col A | col B |
-----------------
|  1    | a     |
|  2    | a     |
|  3    | a     |

-DataFrame 2

| col A | col B |
-----------------
|  1    | b     |
|  3    | b     |

-DataFrame 3

| col A | col B |
-----------------
|  2    | c     |
|  3    | c     |

```

Final Output frame should be 

```
| col A | col B |
-----------------
|  1    | a,b   |
|  2    | a,c   |
|  3    | a,b,c |

```

Number of frames are not limited to 3 , it can be any number less than 100.So I am using for each in which I am printing each of the data frame.

Can some one please help me how I can create final data frame in which I can have output in above format with N data frames.

I appreciate your help.