I have a nested json that I am trying to flatten in usql. I cannot share the data, but the structure is similar to this.
{
"userlist": [user1, user1],
"objects": {
"largeobjects": [object1, object2, object3]
"smallobjects": [s_object1, s_object2]
},
"applications": [{
"application": sdq3ds5dsa
}, {
"application": dksah122j4
}, {
"application": sadsw2dq2s
}, {
"application": pro3dfdsn3
}
],
"date" : 12344232,
"timezone" : "Asia",
"id" : "sad2ddssa2",
"admin": {
"lang": "eng",
"country": "us",
}
}
I am using the custom jsonoutputter (https://github.com/Azure/usql/tree/master/Examples/DataFormats/Microsoft.Analytics.Samples.Formats) to extract from the json file and the jsontuple function to extract the values. My problem is that the function uses sql map which generates key value pairs. This works for the situations where I have a key, but it throws an error when I try to use that function to get the values from the no key array.
Any suggestion regarding how to solve this would be greatly appreciated.
EDIT This is the output I am looking after:
sad2ddssa2, object1, 12344232, "Asia", "eng", "us",
sad2ddssa2, object2, 12344232, "Asia", "eng", "us"