File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
sql/moz-fx-data-shared-prod/firefox_desktop/enterprise_metrics_clients_legacy Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 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`
You can’t perform that action at this time.
0 commit comments