How to Query Multiple Firebase Projects in Bigquer

2020-05-09 00:51发布

问题:

How to put Select query to pull data from Multiple Firebase Projects

How to query abc project & xyz project in a single query. At present i am putting two queries to extract data from Project abc & xyz & its dataset tables.

Querying abc Project

SELECT app_info.id,event_date,app_info.version,
count(*) as sessions,
count( distinct user_pseudo_id ) as uniqueusers 
FROM `abc-1075.analytics_151541058.events_*`
where event_name='session_start' and 
_TABLE_SUFFIX BETWEEN '20190901' AND '20190931' group by 1,2,3

Querying xyz Project

SELECT app_info.id,event_date,app_info.version,
count(*) as sessions,
count( distinct user_pseudo_id ) as uniqueusers 
FROM `xyz-1056.analytics_151414092.events_*`
where event_name='session_start' and 
_TABLE_SUFFIX BETWEEN '20190901' AND '20190931' group by 1,2,3

Expected results from Single Query from two Firebase Projects

Pls. Note: com.abc data is pulled from project abc datasets tables com.xyz data is pulled from project xyz datasets tables.

id version event_date sessions uniqueusers

com.abc 6.6 01-Sep-19 45745 17098

com.xyz 6.7 01-Sep-19 42372 12087

How to put Select query to pull data from Multiple Firebase Projects... Pls Help