如何在 BigQuery 中选择多个自定义 Firebase 事件参数? [英] How to select multiple custom Firebase event parameters in BigQuery?
本文介绍了如何在 BigQuery 中选择多个自定义 Firebase 事件参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将 Firebase 事件导出到 BigQuery,现在我尝试从某个事件中选择两个参数.这是选择一个参数的查询:
I exported Firebase events to BigQuery and now I'm trying to select two parameters from a certain event. Here is the query for selecting one parameter:
select event_dim.params.value.int_value as level_id
from [com_company_appname_ANDROID.app_events_20161210]
where event_dim.name = "level_replays_until_first_victory" and event_dim.params.key = "level_id"
两个参数都是int值,第一个参数的名字是level_id
,第二个参数是count
.我想显示的是第一列中的 level_id
和第二列中的 count
.
Both parameters are int values, name of the first parameter is level_id
, and the second parameter is count
. What I would like is to show is level_id
in first column and count
in second column.
推荐答案
下面将使用 BigQuery 标准 SQL
SELECT
(SELECT params.value.int_value FROM x.params
WHERE params.key = 'level_id') AS level_id,
(SELECT params.value.int_value FROM x.params
WHERE params.key = 'count') AS count
FROM `com_company_appname_ANDROID.app_events_20161210`, UNNEST(event_dim) AS x
WHERE x.name = 'level_replays_until_first_victory'
另请参阅从旧 SQL 迁移 以防你被遗留 SQL 困住
See also Migrating from legacy SQL in case if you are stuck with Legacy SQL
这篇关于如何在 BigQuery 中选择多个自定义 Firebase 事件参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文