I currently have a json file that i am trying to query with sqlContext.sql() that looks something like this:
{
"sample": {
"persons": [
{
"id": "123",
},
{
"id": "456",
}
]
}
}
If I just want the first value I would type:
sqlContext.sql("SELECT sample.persons[0] FROM test")
but I want all the values of "persons" without having to write a loop. Loops just consume too much processing power, and given the size of these files, that would just be impractical.
I thought I would be able to put a range in the [] brackets but I can't find any syntax by which to do that.