Skip to content

Commit

Permalink
Create aggregate tables for Firefox Health Indicators dashboard (#6699)
Browse files Browse the repository at this point in the history
* Create new aggregate table for Firefox Health Indicator dashboard

* Create new video playback by OS version table

* Create agg table at country level

* Fix SQL formatting
  • Loading branch information
kwindau authored Dec 18, 2024
1 parent 93f99d3 commit 6f23929
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.telemetry.fx_health_ind_vid_plybck_by_country`
AS
SELECT
*
FROM
`moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_country_v1`
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.telemetry.fx_health_ind_vid_plybck_by_os`
AS
SELECT
*
FROM
`moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_os_v1`
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.telemetry.fx_health_ind_vid_plybck_by_os_version`
AS
SELECT
*
FROM
`moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_os_version_v1`
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
friendly_name: Fx Health Ind Vid Plybck By Os
description: |-
Aggregate table of video playback minutes per user per OS
owners:
- kwindau@mozilla.com
labels:
incremental: true
owner1: kwindau@mozilla.com
table_type: aggregate
scheduling:
dag_name: bqetl_fx_health_ind_dashboard
bigquery:
time_partitioning:
type: day
field: submission_date
require_partition_filter: false
expiration_days: null
range_partitioning: null
clustering:
fields:
- normalized_country_code
references: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SELECT
DATE(submission_timestamp) AS submission_date,
normalized_country_code,
SUM(
`moz-fx-data-shared-prod.udf.histogram_max_key_with_nonzero_value`(
payload.processes.content.histograms.video_play_time_ms
)
) / COUNT(DISTINCT client_id) / 60000 AS play_time_ratio
FROM
`moz-fx-data-shared-prod.telemetry.main_1pct`
WHERE
DATE(submission_timestamp) = @submission_date
GROUP BY
DATE(submission_timestamp),
normalized_country_code
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fields:
- mode: NULLABLE
name: submission_date
type: DATE
description: Submission Date
- mode: NULLABLE
name: normalized_country_code
type: STRING
description: Normalized Country Code
- mode: NULLABLE
name: play_time_ratio
type: FLOAT
description: Play Time Ratio
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
friendly_name: Fx Health Ind Vid Plybck By Os
description: |-
Aggregate table of video playback minutes per user per OS
owners:
- kwindau@mozilla.com
labels:
incremental: true
owner1: kwindau@mozilla.com
table_type: aggregate
scheduling:
dag_name: bqetl_fx_health_ind_dashboard
bigquery:
time_partitioning:
type: day
field: submission_date
require_partition_filter: false
expiration_days: null
range_partitioning: null
clustering:
fields:
- normalized_os
references: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SELECT
DATE(submission_timestamp) AS submission_date,
normalized_os,
SUM(
`moz-fx-data-shared-prod.udf.histogram_max_key_with_nonzero_value`(
payload.processes.content.histograms.video_play_time_ms
)
) / COUNT(DISTINCT client_id) / 60000 AS play_time_ratio
FROM
`moz-fx-data-shared-prod.telemetry.main`
WHERE
DATE(submission_timestamp) = @submission_date
AND normalized_os IN ('Windows', 'Linux', 'Mac')
AND sample_id = 42
GROUP BY
DATE(submission_timestamp),
normalized_os
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fields:
- mode: NULLABLE
name: submission_date
type: DATE
description: Submission Date
- mode: NULLABLE
name: normalized_os
type: STRING
description: Normalized Operating System
- mode: NULLABLE
name: play_time_ratio
type: FLOAT
description: Play Time Ratio
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
friendly_name: Fx Health Ind Vid Plybck By Os
description: |-
Aggregate table of video playback minutes per user per OS
owners:
- kwindau@mozilla.com
labels:
incremental: true
owner1: kwindau@mozilla.com
table_type: aggregate
scheduling:
dag_name: bqetl_fx_health_ind_dashboard
bigquery:
time_partitioning:
type: day
field: submission_date
require_partition_filter: false
expiration_days: null
range_partitioning: null
clustering:
fields:
- normalized_os_version
references: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SELECT
DATE(submission_timestamp) AS submission_date,
normalized_os_version,
SUM(
`moz-fx-data-shared-prod.udf.histogram_max_key_with_nonzero_value`(
payload.processes.content.histograms.video_play_time_ms
)
) / COUNT(DISTINCT client_id) / 60000 AS play_time_ratio
FROM
`moz-fx-data-shared-prod.telemetry.main_1pct`
WHERE
DATE(submission_timestamp) = @submission_date
AND normalized_os = 'Windows'
GROUP BY
DATE(submission_timestamp),
normalized_os_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fields:
- mode: NULLABLE
name: submission_date
type: DATE
description: Submission Date
- mode: NULLABLE
name: normalized_os_version
type: STRING
description: Normalized Operating System Version
- mode: NULLABLE
name: play_time_ratio
type: FLOAT
description: Play Time Ratio

1 comment on commit 6f23929

@dataops-ci-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration report for "Create aggregate tables for Firefox Health Indicators dashboard (#6699)"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_fx_health_ind_dashboard.py /tmp/workspace/generated-sql/dags/bqetl_fx_health_ind_dashboard.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_fx_health_ind_dashboard.py	2024-12-18 19:19:46.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_fx_health_ind_dashboard.py	2024-12-18 19:21:45.000000000 +0000
@@ -170,6 +170,19 @@
         pool="DATA_ENG_EXTERNALTASKSENSOR",
     )
 
+    wait_for_copy_deduplicate_main_ping = ExternalTaskSensor(
+        task_id="wait_for_copy_deduplicate_main_ping",
+        external_dag_id="copy_deduplicate",
+        external_task_id="copy_deduplicate_main_ping",
+        execution_delta=datetime.timedelta(seconds=54000),
+        check_existence=True,
+        mode="reschedule",
+        poke_interval=datetime.timedelta(minutes=5),
+        allowed_states=ALLOWED_STATES,
+        failed_states=FAILED_STATES,
+        pool="DATA_ENG_EXTERNALTASKSENSOR",
+    )
+
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -255,6 +268,39 @@
         parameters=["submission_date:DATE:{{macros.ds_add(ds, -1)}}"],
     )
 
+    telemetry_derived__fx_health_ind_vid_plybck_by_country__v1 = bigquery_etl_query(
+        task_id="telemetry_derived__fx_health_ind_vid_plybck_by_country__v1",
+        destination_table="fx_health_ind_vid_plybck_by_country_v1",
+        dataset_id="telemetry_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="kwindau@mozilla.com",
+        email=["kwindau@mozilla.com", "telemetry-alerts@mozilla.com"],
+        date_partition_parameter="submission_date",
+        depends_on_past=False,
+    )
+
+    telemetry_derived__fx_health_ind_vid_plybck_by_os__v1 = bigquery_etl_query(
+        task_id="telemetry_derived__fx_health_ind_vid_plybck_by_os__v1",
+        destination_table="fx_health_ind_vid_plybck_by_os_v1",
+        dataset_id="telemetry_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="kwindau@mozilla.com",
+        email=["kwindau@mozilla.com", "telemetry-alerts@mozilla.com"],
+        date_partition_parameter="submission_date",
+        depends_on_past=False,
+    )
+
+    telemetry_derived__fx_health_ind_vid_plybck_by_os_version__v1 = bigquery_etl_query(
+        task_id="telemetry_derived__fx_health_ind_vid_plybck_by_os_version__v1",
+        destination_table="fx_health_ind_vid_plybck_by_os_version_v1",
+        dataset_id="telemetry_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="kwindau@mozilla.com",
+        email=["kwindau@mozilla.com", "telemetry-alerts@mozilla.com"],
+        date_partition_parameter="submission_date",
+        depends_on_past=False,
+    )
+
     telemetry_derived__fx_health_ind_win_instll_by_instll_typ__v1 = bigquery_etl_query(
         task_id="telemetry_derived__fx_health_ind_win_instll_by_instll_typ__v1",
         destination_table="fx_health_ind_win_instll_by_instll_typ_v1",
@@ -361,6 +407,18 @@
         wait_for_firefox_desktop_active_users_aggregates_v4
     )
 
+    telemetry_derived__fx_health_ind_vid_plybck_by_country__v1.set_upstream(
+        wait_for_telemetry_derived__main_remainder_1pct__v1
+    )
+
+    telemetry_derived__fx_health_ind_vid_plybck_by_os__v1.set_upstream(
+        wait_for_copy_deduplicate_main_ping
+    )
+
+    telemetry_derived__fx_health_ind_vid_plybck_by_os_version__v1.set_upstream(
+        wait_for_telemetry_derived__main_remainder_1pct__v1
+    )
+
     telemetry_derived__fx_health_ind_win_instll_by_instll_typ__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry: fx_health_ind_vid_plybck_by_country
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry: fx_health_ind_vid_plybck_by_os
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry: fx_health_ind_vid_plybck_by_os_version
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived: fx_health_ind_vid_plybck_by_country_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived: fx_health_ind_vid_plybck_by_os_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived: fx_health_ind_vid_plybck_by_os_version_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/apple_ads_external/ios_app_campaign_stats_v1/bigconfig.yml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/apple_ads_external/ios_app_campaign_stats_v1/bigconfig.yml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/apple_ads_external/ios_app_campaign_stats_v1/bigconfig.yml	2024-12-18 19:14:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/apple_ads_external/ios_app_campaign_stats_v1/bigconfig.yml	2024-12-18 19:18:10.000000000 +0000
@@ -1,7 +1,6 @@
 type: BIGCONFIG_FILE
-
 tag_deployments:
-  - collection:
+- collection:
       name: Operational Checks
       notification_channels:
         - slack: '#de-bigeye-triage'
@@ -24,10 +23,10 @@
         metrics:
           - saved_metric_id: is_not_null
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
       - column_selectors:
@@ -35,10 +34,10 @@
         metrics:
           - saved_metric_id: is_2_char_len
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
       - column_selectors:
@@ -46,17 +45,17 @@
         metrics:
           - saved_metric_id: volume
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
           - saved_metric_id: freshness
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/bigconfig.yml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/bigconfig.yml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/bigconfig.yml	2024-12-18 19:14:14.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/google_ads_derived/android_app_campaign_stats_v1/bigconfig.yml	2024-12-18 19:18:13.000000000 +0000
@@ -1,7 +1,6 @@
 type: BIGCONFIG_FILE
-
 tag_deployments:
-  - collection:
+- collection:
       name: Operational Checks
       notification_channels:
         - slack: '#de-bigeye-triage'
@@ -23,10 +22,10 @@
         metrics:
           - saved_metric_id: is_not_null
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
       - column_selectors:
@@ -34,10 +33,10 @@
         metrics:
           - saved_metric_id: is_2_char_len
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
       - column_selectors:
@@ -45,17 +44,17 @@
         metrics:
           - saved_metric_id: volume
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
           - saved_metric_id: freshness
             lookback:
-              lookback_type: DATA_TIME
               lookback_window:
                 interval_type: DAYS
                 interval_value: 28
+        lookback_type: DATA_TIME
             rct_overrides:
               - date
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/metadata.yaml	2024-12-18 19:16:43.000000000 +0000
@@ -0,0 +1,14 @@
+friendly_name: Fx Health Ind Vid Plybck By Country
+description: |-
+  Please provide a description for the query
+owners: []
+labels: {}
+bigquery: null
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:dataops-managed/taar
+  - workgroup:mozilla-confidential
+references:
+  view.sql:
+  - moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_country_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_country/view.sql	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,7 @@
+CREATE OR REPLACE VIEW
+  `moz-fx-data-shared-prod.telemetry.fx_health_ind_vid_plybck_by_country`
+AS
+SELECT
+  *
+FROM
+  `moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_country_v1`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/metadata.yaml	2024-12-18 19:16:43.000000000 +0000
@@ -0,0 +1,14 @@
+friendly_name: Fx Health Ind Vid Plybck By Os
+description: |-
+  Please provide a description for the query
+owners: []
+labels: {}
+bigquery: null
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:dataops-managed/taar
+  - workgroup:mozilla-confidential
+references:
+  view.sql:
+  - moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_os_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os/view.sql	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,7 @@
+CREATE OR REPLACE VIEW
+  `moz-fx-data-shared-prod.telemetry.fx_health_ind_vid_plybck_by_os`
+AS
+SELECT
+  *
+FROM
+  `moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_os_v1`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/metadata.yaml	2024-12-18 19:16:43.000000000 +0000
@@ -0,0 +1,14 @@
+friendly_name: Fx Health Ind Vid Plybck By Os Version
+description: |-
+  Please provide a description for the query
+owners: []
+labels: {}
+bigquery: null
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:dataops-managed/taar
+  - workgroup:mozilla-confidential
+references:
+  view.sql:
+  - moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_os_version_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/fx_health_ind_vid_plybck_by_os_version/view.sql	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,7 @@
+CREATE OR REPLACE VIEW
+  `moz-fx-data-shared-prod.telemetry.fx_health_ind_vid_plybck_by_os_version`
+AS
+SELECT
+  *
+FROM
+  `moz-fx-data-shared-prod.telemetry_derived.fx_health_ind_vid_plybck_by_os_version_v1`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/metadata.yaml	2024-12-18 19:16:36.000000000 +0000
@@ -0,0 +1,27 @@
+friendly_name: Fx Health Ind Vid Plybck By Os
+description: |-
+  Aggregate table of video playback minutes per user per OS
+owners:
+- kwindau@mozilla.com
+labels:
+  incremental: true
+  owner1: kwindau
+  table_type: aggregate
+  dag: bqetl_fx_health_ind_dashboard
+scheduling:
+  dag_name: bqetl_fx_health_ind_dashboard
+bigquery:
+  time_partitioning:
+    type: day
+    field: submission_date
+    require_partition_filter: false
+    expiration_days: null
+  range_partitioning: null
+  clustering:
+    fields:
+    - normalized_country_code
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:mozilla-confidential
+references: {}
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/query.sql	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,15 @@
+SELECT
+  DATE(submission_timestamp) AS submission_date,
+  normalized_country_code,
+  SUM(
+    `moz-fx-data-shared-prod.udf.histogram_max_key_with_nonzero_value`(
+      payload.processes.content.histograms.video_play_time_ms
+    )
+  ) / COUNT(DISTINCT client_id) / 60000 AS play_time_ratio
+FROM
+  `moz-fx-data-shared-prod.telemetry.main_1pct`
+WHERE
+  DATE(submission_timestamp) = @submission_date
+GROUP BY
+  DATE(submission_timestamp),
+  normalized_country_code
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/schema.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_country_v1/schema.yaml	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,13 @@
+fields:
+- mode: NULLABLE
+  name: submission_date
+  type: DATE
+  description: Submission Date
+- mode: NULLABLE
+  name: normalized_country_code
+  type: STRING
+  description: Normalized Country Code
+- mode: NULLABLE
+  name: play_time_ratio
+  type: FLOAT
+  description: Play Time Ratio
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/metadata.yaml	2024-12-18 19:16:36.000000000 +0000
@@ -0,0 +1,27 @@
+friendly_name: Fx Health Ind Vid Plybck By Os
+description: |-
+  Aggregate table of video playback minutes per user per OS
+owners:
+- kwindau@mozilla.com
+labels:
+  incremental: true
+  owner1: kwindau
+  table_type: aggregate
+  dag: bqetl_fx_health_ind_dashboard
+scheduling:
+  dag_name: bqetl_fx_health_ind_dashboard
+bigquery:
+  time_partitioning:
+    type: day
+    field: submission_date
+    require_partition_filter: false
+    expiration_days: null
+  range_partitioning: null
+  clustering:
+    fields:
+    - normalized_os
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:mozilla-confidential
+references: {}
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/query.sql	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,17 @@
+SELECT
+  DATE(submission_timestamp) AS submission_date,
+  normalized_os,
+  SUM(
+    `moz-fx-data-shared-prod.udf.histogram_max_key_with_nonzero_value`(
+      payload.processes.content.histograms.video_play_time_ms
+    )
+  ) / COUNT(DISTINCT client_id) / 60000 AS play_time_ratio
+FROM
+  `moz-fx-data-shared-prod.telemetry.main`
+WHERE
+  DATE(submission_timestamp) = @submission_date
+  AND normalized_os IN ('Windows', 'Linux', 'Mac')
+  AND sample_id = 42
+GROUP BY
+  DATE(submission_timestamp),
+  normalized_os
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/schema.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_v1/schema.yaml	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,13 @@
+fields:
+- mode: NULLABLE
+  name: submission_date
+  type: DATE
+  description: Submission Date
+- mode: NULLABLE
+  name: normalized_os
+  type: STRING
+  description: Normalized Operating System
+- mode: NULLABLE
+  name: play_time_ratio
+  type: FLOAT
+  description: Play Time Ratio
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/metadata.yaml	2024-12-18 19:16:36.000000000 +0000
@@ -0,0 +1,27 @@
+friendly_name: Fx Health Ind Vid Plybck By Os
+description: |-
+  Aggregate table of video playback minutes per user per OS
+owners:
+- kwindau@mozilla.com
+labels:
+  incremental: true
+  owner1: kwindau
+  table_type: aggregate
+  dag: bqetl_fx_health_ind_dashboard
+scheduling:
+  dag_name: bqetl_fx_health_ind_dashboard
+bigquery:
+  time_partitioning:
+    type: day
+    field: submission_date
+    require_partition_filter: false
+    expiration_days: null
+  range_partitioning: null
+  clustering:
+    fields:
+    - normalized_os_version
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:mozilla-confidential
+references: {}
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/query.sql	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,16 @@
+SELECT
+  DATE(submission_timestamp) AS submission_date,
+  normalized_os_version,
+  SUM(
+    `moz-fx-data-shared-prod.udf.histogram_max_key_with_nonzero_value`(
+      payload.processes.content.histograms.video_play_time_ms
+    )
+  ) / COUNT(DISTINCT client_id) / 60000 AS play_time_ratio
+FROM
+  `moz-fx-data-shared-prod.telemetry.main_1pct`
+WHERE
+  DATE(submission_timestamp) = @submission_date
+  AND normalized_os = 'Windows'
+GROUP BY
+  DATE(submission_timestamp),
+  normalized_os_version
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/schema.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry_derived/fx_health_ind_vid_plybck_by_os_version_v1/schema.yaml	2024-12-18 19:14:14.000000000 +0000
@@ -0,0 +1,13 @@
+fields:
+- mode: NULLABLE
+  name: submission_date
+  type: DATE
+  description: Submission Date
+- mode: NULLABLE
+  name: normalized_os_version
+  type: STRING
+  description: Normalized Operating System Version
+- mode: NULLABLE
+  name: play_time_ratio
+  type: FLOAT
+  description: Play Time Ratio

Link to full diff

Please sign in to comment.