I have a Spark Dataset containing a single column of ArrayType which denotes the path from one user to another through their mutual friends
| path |
|---|
| ["Amy","John","Wally"] |
| ["Beth","Sally","Tim","Jacob"] |
What I would like to achieve in the end is a table that explicitly lists the edges in the paths. (i.e. an edgelist)
| src | dest |
|---|---|
| "Amy" | "John" |
| "John" | "Amy" |
| "John" | "Wally" |
| "Beth" | "Sally" |
| "Sally" | "Tim" |
| "Tim" | "Sally" |
| "Tim" | "Jacob" |
| "Jacob" | "Tim" |
How should I go about trying to transform the former table into the latter one?