Skip to content

Commit

Permalink
Use mozfun.norm.fenix_app_info for nondesktop_clients_last_seen (#1245)
Browse files Browse the repository at this point in the history
* Use mozfun.norm.fenix_app_info for nondesktop_clients_last_seen

After this is merged, we can backfill of smoot tables to have GUD
reflect the current and historical app naming schemes.
  • Loading branch information
jklukas authored Aug 21, 2020
1 parent aa3f827 commit 4fe4323
Showing 1 changed file with 31 additions and 13 deletions.
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

0 comments on commit 4fe4323

Please sign in to comment.