I have a table that looks like this:
| date | volume_info |
|---|---|
| 2022-01-01 | {"temple": 18348, "benny": 8524, "polly": 1698, "sally": 5860} |
| 2022-01-02 | {"temple": 2000, "benny": 1000, "polly": 3904, "sally": 1776, "benjamin": 2} |
And I am trying to set it up like this:
| date | temple | benny | polly | sally | benjamin |
|---|---|---|---|---|---|
| 2022-01-01 | 18348 | 8524 | 1698 | 5860 | NULL |
| 2022-01-02 | 2000 | 1000 | 3904 | 1776 | 2 |
But I don't know how many items are in the map (the first table is updated once a day) so I would like to unpack the map and have them be set as columns without knowing ahead of time how many items are in the map.
Is it possible to "pivot" these values without knowing ahead of time what the keys in the map are?