Create dataframe from complex json data


#1

How to create dataframe from below complex json data in Spark using Scala? For all values of cols there should be one column and data for that column should be in that only.

{“cols”:
[“Company”,
“Revenue”,
“ID”
],
“data”: [
[
“Dictum Eu Associates”,
“0”,
“4722D7C5-7EBA-8A09-BACD-9BCAD34735FA”
],
[
“Associates Dictum Eu”,
“15”,
“9BCAD34735-7EBA-8A09-BACD-9BCAD34735FA”
]
]}