Skip to content

Commit

Permalink
Fix union error in telemetry.active_users_aggregates_mobile view.
Browse files Browse the repository at this point in the history
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
sean-rose committed Jun 6, 2024
1 parent c129115 commit 6b00305
Showing 1 changed file with 49 additions and 31 deletions.
80 changes: 49 additions & 31 deletions sql_generators/active_users_aggregates_v3/templates/mobile_view.sql
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 %}

0 comments on commit 6b00305

Please sign in to comment.