I have a json file just like below, and I need to read it and generate a table with the attributes of the person.
{
"person":[
[
"name",
"Guy"
],
[
"age",
"25"
],
[
"height",
"2.00"
]
]
}
name | age | height |
---|---|---|
Guy | 25 | 2.00 |
What’s the easiest way and performatic way to read this json and output a table?
I’m thinking about converting the list as key-values pair, but since i’m working with loads of data it would be underperformatic.
And I’m having trouble exploding it because of other data in the dataframe.
2
Answers
You can read do this using below command, specify mulitline=True
Also above question is answered before
How to create a spark DataFrame from Nested JSON structure
Try this: