Home > Net >  Bigquery - json_array extract and count elements from a nested arrays
Bigquery - json_array extract and count elements from a nested arrays

Time:01-06

I have a JSON field my table which looks like this. There could be any number of menu categories and any number of items

{
"menu": {
    "salad": [
        {
            "item": "russian salad"
        },
        {
            "item": "french salad"
        }
    ],
    "soups": [
        {
            "item": "french soup"
        },
        {
            "item": "english soup"
        },
        {
            "item": "english soup"
        }
    ]
}

There could be any number of menu category (salad, soup) plus any number of items within each category

salad | 2
soups | 3

I've looked at my enter image description here

  •  Tags:  
  • Related