skip to Main Content

Unnest non-array JSON in BigQuery

I have data arriving as separate events in JSON form resembling: { "id":1234, "data":{ "packet1":{"name":"packet1", "value":1}, "packet2":{"name":"packet2", "value":2} } } I'd like to unnest the data to essentially have one row per 'packet' (there may be any number of packets).…

VIEW QUESTION

BigQuery Merge and Sum JSON Documents

I want to merge JSON string in a table and sum its value after group for Eg:- 2023, {"hen":4, "owl":3} 2023, {"crow":4, "owl":2} 2022, {"owl":6, "crow":2} 2022, {"hen":5} 2021, {"hen":2, "crow":1} Result could be like below 2023, {"hen":4, "owl":5, "crow":4}…

VIEW QUESTION
Back To Top
Search