I have a json structure in a field json_s in table mytable as follows (this is example for one row, there will be many similar rows)
{
"100": {
"1": [[2,3],2] ,
"4": [[10], 0]
},
"102": {
"7":[[5,6],5]
}
}
which I want to convert into a json_table for further use in different queries. The json table structure should be like this
field_a | field_b | field_c |
100 | 1 | 2 |
100 | 1 | 3 |
100 | 4 | 10 |
102 | 7 | 5 |
102 | 7 | 6 |
I have tried many solutions from other questions like this but not successful so far. One major problem is that I have unknown keys whom I want to assign in json column and the structure is nested at two levels.
EDIT: The structure to field mapping will be like this
{ "field_a" : {
"field_b" : [ ["field_c1", "field_c2",... ] , x]
}}
meaning ignoring the x element