I am trying to create a query in BigQuery.
My table looks like this. So there are a lot of events of show_in_detail and I want to access the ID (1234) and the name (Blablabla) of all events accumulated over a specific date sorted by the most popular ID in descending order. How do I do this?
+----------------+------------------+---------------------------------+
| event_name | event_params.key | event_params.value.string_value |
+----------------+------------------+---------------------------------+
|show_in_detail | id | 1234 |
|show_in_detail | name | Blablabla |
+----------------+------------------+---------------------------------+
I tried:
SELECT event_params.key FROM `tablename_and_date` LIMIT 1000
But got the error:
Cannot access field key on a value with type ARRAY<STRUCT<key STRING, value STRUCT<string_value STRING, int_value INT64, float_value FLOAT64, ...>>> at [1:21]