gpt4 book ai didi

google-bigquery - BigQuery 选择多个键值

转载 作者:行者123 更新时间:2023-12-04 23:55:33 28 4
gpt4 key购买 nike

通过将 Firebase 中的自定义事件导出到 BigQuery,其中可以存在多个键值参数。我似乎无法弄清楚如何使用“标准 SQL”选择其中之一。

How would I project both msg and succes values (string_value and int_value) into one record

最佳答案

假设您想选择 string_value对应于 firebase_event_originint_valuefirebase_screen_id 相关联所有 control_reading事件。您可以将查询表示为:

#standardSQL
SELECT
(SELECT param.value.string_value
FROM UNNEST(event_dim.params) AS param
WHERE param.key = 'firebase_event_origin') AS firebase_event_origin,
(SELECT param.value.int_value
FROM UNNEST(event_dim.params) AS param
WHERE param.key = 'firebase_screen_id') AS firebase_screen_id
FROM `your_dataset.your_table_*`
CROSS JOIN UNNEST(event_dim) AS event_dim
WHERE _TABLE_SUFFIX BETWEEN '20170501' AND '20170503' AND
event_dim.name = 'control_reading';

关于google-bigquery - BigQuery 选择多个键值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43792292/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com