I have a question about a json. Is the json below a standard of some kind. I can see why its preferable as the element names are written once and datatypes are included. I cannot change how the JSON comes in, but is there a Java library that easily parses it? Of course I can loop and loop but there must be something that parses it. I tried both with Jackson and org.json but both fail as it is an array at start. Also "jq" parses it and I can get to the value "100" that I want as the COUNT but if the schema comes in different than directly referencing the array indexes would break.
[
{
"header": {
"queryId": "query_1590948930986",
"schema": "`ROWKEY` STRING KEY, `USERID` STRING, `ENTITYTYPE` STRING, `ENTITYID` STRING, `DATESEARCHED` STRING, `COUNT` BIGINT"
}
},
{
"row": {
"columns": [
"6938bb62-50a1-4d0b-a113-1ecca1082763|+|n|+|09066437|+|2020-05-11",
"6938bb62-50a1-4d0b-a113-1ecca1082763",
"n",
"09066437",
"2020-05-11",
100
]
}
}
]
in jq I can do this. but will fail if schema element comes in different.
| jq '.[1].row.columns[5]'