There is a map nested in a large json payload like
{
"map": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
},
// more stuff
}
I would like to generate a table like that:
+------#--------+
| Key | Value |
+------#--------+
| key1 | value1 |
| key2 | value2 |
| key3 | value3 |
+------#--------+
The only thing I can think of is writing a stored function that loops over JSON_KEYS to convert all key value pairs into
[{"key":"key1", "value":"value1"}, {"key":"key2", "value":"value2"}, ...]
which makes the task trivial with JSON_TABLE.
Is there a faster and more elegant way?