I am parsing a JSON field in Redshift but the values are 6 levels deep. AWS says JSON_EXTRACT_PATH_TEXT has a 5 level limitation. I briefly tried a cte but am going down a rabbit hole as SQL and JSON are new to me. Alternatively I am wondering if the best place to do this is in dbt. If so I could see if that rabbit hole is less deep.
Code:
{
"overall": {
"WE": {
"A": {
"WE: one": "1",
"WE: two": "5",
"Work: three": "1"
}}
}
Expected Results:
WE name value
-- ---- -----
A one 1
A two 5
A three 1