Skip to content

Commit 83b39fb

Browse files
committed
feat: add enterprise_metrics_clients_legacy virw
1 parent fc149c6 commit 83b39fb

File tree

1 file changed

+34
-0
lines changed
  • sql/moz-fx-data-shared-prod/firefox_desktop/enterprise_metrics_clients_legacy

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CREATE OR REPLACE VIEW
2+
`moz-fx-data-shared-prod.firefox_desktop.enterprise_metrics_clients_legacy`
3+
AS
4+
SELECT
5+
*,
6+
CASE
7+
WHEN normalized_channel = "release"
8+
AND ((policies_count > 1) OR (policies_is_enterprise = TRUE))
9+
THEN "enterprise_release"
10+
WHEN normalized_channel = "release"
11+
AND (
12+
(distribution_id IS NOT NULL)
13+
OR (policies_count = 0)
14+
OR (policies_is_enterprise = FALSE)
15+
)
16+
THEN "consumer_release"
17+
WHEN normalized_channel = "esr"
18+
AND ((policies_count > 1) AND (distribution_id IS NULL))
19+
THEN "enterprise_esr"
20+
WHEN normalized_channel = "esr"
21+
AND (
22+
(distribution_id IS NOT NULL)
23+
OR (policies_count = 0)
24+
OR (policies_is_enterprise = FALSE)
25+
)
26+
THEN "consumer_esr"
27+
WHEN normalized_channel = "release"
28+
THEN "unknown_release"
29+
WHEN normalized_channel = "esr"
30+
THEN "unknown_esr"
31+
ELSE "unexpected_classification" -- TODO: we should set up an alert for this, but not fail the query.
32+
END AS enterprise_classification,
33+
FROM
34+
`moz-fx-data-shared-prod.firefox_desktop_derived.enterprise_metrics_clients_legacy_v1`

0 commit comments

Comments
 (0)