I'm new to spark, but I can't find the answer to a simple question: How to change row to columns? For example, I have data like:
Type | Col1 | Col2 | Col3 |... | Col60
1 | 12 | 3 | 4 |... | 87
2 | 1 | 5 | 6 |... | 90
I want to change it to like
Type | ColName | Value
1 | Col1 | 12
1 | Col2 | 3
1 | Col3 | 4
...
1 | Col60 | 87
2 | Col1 | 1
2 | Col2 | 5
2 | Col3 | 6
...
2 | Col60 | 90
I've tried to search many places, but there is no answer exactly like what I need.