-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix union error in
telemetry.active_users_aggregates_mobile
view.
The `klar_android.active_users_aggregates` view and its underlying `klar_android_derived.active_users_aggregates_v3` table have a different schema than the rest of the apps, because it was added more recently (#5624) after some columns were removed from the `active_users_aggregates_v3` ETL (#5396).
- Loading branch information
Showing
1 changed file
with
49 additions
and
31 deletions.
There are no files selected for viewing
80 changes: 49 additions & 31 deletions
80
sql_generators/active_users_aggregates_v3/templates/mobile_view.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,51 @@ | ||
--- User-facing view for all mobile apps. Generated via sql_generators.active_users. | ||
CREATE OR REPLACE VIEW | ||
`{{ project_id }}.{{ dataset_id }}.active_users_aggregates_mobile` | ||
AS | ||
SELECT | ||
* | ||
FROM | ||
`{{ project_id }}.{{ fenix_dataset }}.active_users_aggregates` | ||
UNION ALL | ||
SELECT | ||
* | ||
FROM | ||
`{{ project_id }}.{{ firefox_ios_dataset }}.active_users_aggregates` | ||
UNION ALL | ||
SELECT | ||
* | ||
FROM | ||
`{{ project_id }}.{{ focus_ios_dataset }}.active_users_aggregates` | ||
UNION ALL | ||
SELECT | ||
* | ||
FROM | ||
`{{ project_id }}.{{ klar_ios_dataset }}.active_users_aggregates` | ||
UNION ALL | ||
SELECT | ||
* | ||
FROM | ||
`{{ project_id }}.{{ focus_android_dataset }}.active_users_aggregates` | ||
UNION ALL | ||
SELECT | ||
* | ||
FROM | ||
`{{ project_id }}.{{ klar_android_dataset }}.active_users_aggregates` | ||
`{{ project_id }}.{{ dataset_id }}.active_users_aggregates_mobile` AS | ||
{% for app_dataset_id in [ | ||
fenix_dataset, | ||
firefox_ios_dataset, | ||
focus_ios_dataset, | ||
klar_ios_dataset, | ||
focus_android_dataset, | ||
klar_android_dataset | ||
] %} | ||
{% if not loop.first %} | ||
UNION ALL | ||
{% endif %} | ||
SELECT | ||
segment, | ||
attribution_medium, | ||
attribution_source, | ||
attributed, | ||
city, | ||
country, | ||
distribution_id, | ||
first_seen_year, | ||
is_default_browser, | ||
locale, | ||
channel, | ||
os, | ||
os_version, | ||
os_version_major, | ||
os_version_minor, | ||
submission_date, | ||
adjust_network, | ||
install_source, | ||
daily_users, | ||
weekly_users, | ||
monthly_users, | ||
dau, | ||
wau, | ||
mau, | ||
uri_count, | ||
active_hours, | ||
app_name, | ||
app_version, | ||
app_version_major, | ||
app_version_minor, | ||
app_version_patch_revision, | ||
app_version_is_major_release, | ||
os_grouped, | ||
FROM | ||
`{{ project_id }}.{{ app_dataset_id }}.active_users_aggregates` | ||
{% endfor %} |