如何通过bigquery在参数密钥中获取特定的参数值

时间:2018-11-29 08:02:18

标签: google-bigquery

如何通过bigquery获取特定的参数值。我试图从event.param.key = firebase_screen中获取特定值,并且firebase_screen的值为“ Matches-List”。下面的查询显示错误。请救命。

select 
      event_name, 
      param1.value.string_value as firebase_screen,
      param2.value.int_value as engagement_time_msec
    From `<table>`,
    UNNEST(event_params) as param1 where firebase_screen='Matches-List'
    UNNEST(event_params) as param2
    where event_name = 'user_engagement' 
    and param1.key='firebase_screen'
    and param2.key='engagement_time_msec' 
    group by 1, 2, 3 
    order by engagement_time_msec desc   

请。帮助

1 个答案:

答案 0 :(得分:0)

找到了解决方案,以下查询有效。谢谢你的支持。

select 
  event_name, 
  param1.value.string_value as firebasescreen,
  param2.value.int_value as engagement_time_msec
From `<table>`,
UNNEST(event_params) as param1,
UNNEST(event_params) as param2
where event_name = 'user_engagement' 
and param1.key='firebase_screen'
and param2.key='engagement_time_msec'
and param1.value.string_value ='Matches-List'
group by 1, 2, 3 
order by engagement_time_msec desc