Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mozfun.norm.fenix_app_info for nondesktop_clients_last_seen #1245

Merged
merged 5 commits into from
Aug 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions sql/telemetry/nondesktop_clients_last_seen_v1/view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,56 @@ CREATE OR REPLACE VIEW
AS
-- For context on naming and channels of Fenix apps, see:
-- https://docs.google.com/document/d/1Ym4eZyS0WngEP6WdwJjmCoxtoQbJSvORxlQwZpuSV2I/edit#heading=h.69hvvg35j8un
WITH glean_union AS (
-- Fenix apps
WITH fenix_union AS (
SELECT
* REPLACE ('beta' AS normalized_channel),
'Firefox Preview' AS app_name,
*,
'org_mozilla_fenix' AS _dataset
FROM
`moz-fx-data-shared-prod.org_mozilla_fenix.baseline_clients_last_seen`
UNION ALL
SELECT
* REPLACE ('nightly' AS normalized_channel),
'Firefox Preview' AS app_name,
*,
'org_mozilla_fenix_nightly' AS _dataset
FROM
`moz-fx-data-shared-prod.org_mozilla_fenix_nightly.baseline_clients_last_seen`
UNION ALL
SELECT
* REPLACE ('release' AS normalized_channel),
'Fenix' AS app_name,
*,
'org_mozilla_firefox' AS _dataset
FROM
`moz-fx-data-shared-prod.org_mozilla_firefox.baseline_clients_last_seen`
UNION ALL
SELECT
* REPLACE ('beta' AS normalized_channel),
'Fenix' AS app_name,
*,
'org_mozilla_firefox_beta' AS _dataset
FROM
`moz-fx-data-shared-prod.org_mozilla_firefox_beta.baseline_clients_last_seen`
UNION ALL
SELECT
* REPLACE ('nightly' AS normalized_channel),
'Fenix' AS app_name,
*,
'org_mozilla_fennec_aurora' AS _dataset
FROM
`moz-fx-data-shared-prod.org_mozilla_fennec_aurora.baseline_clients_last_seen`
-- Other apps that send Glean telemetry
),
fenix_app_info AS (
SELECT
*,
mozfun.norm.fenix_app_info(_dataset, app_build) AS _app_info
FROM
fenix_union
),
fenix_normalized AS (
SELECT
* EXCEPT (_dataset, _app_info) REPLACE(_app_info.channel AS normalized_channel),
_app_info.app_name,
FROM
fenix_app_info
),
glean_union AS (
SELECT
*
FROM
fenix_normalized
UNION ALL
SELECT
*,
Expand Down