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

feat(DENG-1774 / cancelled): deleting fenix_derived/firefox_android_clients_v2, v1 will remains the active model #4610

Merged

Conversation

kik-kik
Copy link
Contributor

@kik-kik kik-kik commented Nov 28, 2023

feat(DENG-1774 / cancelled): deleting fenix_derived/firefox_android_clients_v2, v1 will remains the active model

Deploying the v2 version of the table proved problematic and in the interest of time we decided for now to continue using v1 as it already contains all the data we need.

There is no impact to this change as the table has not been productionised and there are no current references to the table inside the bqetl repo.

┆Issue is synchronized with this Jira Task

@dataops-ci-bot
Copy link

Integration report for "deleting fenix_derived/firefox_android_clients_v2, v1 will remain the active model"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py	2023-11-28 15:43:02.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py	2023-11-28 15:43:41.000000000 +0000
@@ -47,44 +47,6 @@
     doc_md=docs,
     tags=tags,
 ) as dag:
-    checks__fail_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__fail_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=True,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__warn_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=False,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     clients_first_seen_v2 = bigquery_etl_query(
         task_id="clients_first_seen_v2",
         destination_table="clients_first_seen_v2",
@@ -117,23 +79,6 @@
 
         clients_first_seen_v2_external.set_upstream(clients_first_seen_v2)
 
-    fenix_derived__firefox_android_clients__v2 = bigquery_etl_query(
-        task_id="fenix_derived__firefox_android_clients__v2",
-        destination_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        date_partition_parameter=None,
-        depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1 = bigquery_etl_query(
         task_id="fenix_derived__funnel_retention_clients_week_2__v1",
         destination_table="funnel_retention_clients_week_2_v1",
@@ -228,34 +173,6 @@
         parameters=["submission_date:DATE:{{ds}}"],
     )
 
-    wait_for_baseline_clients_daily = ExternalTaskSensor(
-        task_id="wait_for_baseline_clients_daily",
-        external_dag_id="copy_deduplicate",
-        external_task_id="baseline_clients_daily",
-        execution_delta=datetime.timedelta(seconds=3600),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -295,28 +212,6 @@
 
     clients_first_seen_v2.set_upstream(wait_for_telemetry_derived__clients_daily__v6)
 
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_copy_deduplicate_all
-    )
-    wait_for_fenix_derived__new_profile_activation__v1 = ExternalTaskSensor(
-        task_id="wait_for_fenix_derived__new_profile_activation__v1",
-        external_dag_id="bqetl_mobile_activation",
-        external_task_id="fenix_derived__new_profile_activation__v1",
-        execution_delta=datetime.timedelta(seconds=7200),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_fenix_derived__new_profile_activation__v1
-    )
-
     wait_for_baseline_clients_last_seen = ExternalTaskSensor(
         task_id="wait_for_baseline_clients_last_seen",
         external_dag_id="copy_deduplicate",
@@ -349,6 +244,18 @@
         fenix_derived__funnel_retention_clients_week_4__v1
     )
 
+    wait_for_baseline_clients_daily = ExternalTaskSensor(
+        task_id="wait_for_baseline_clients_daily",
+        external_dag_id="copy_deduplicate",
+        external_task_id="baseline_clients_daily",
+        execution_delta=datetime.timedelta(seconds=3600),
+        check_existence=True,
+        mode="reschedule",
+        allowed_states=ALLOWED_STATES,
+        failed_states=FAILED_STATES,
+        pool="DATA_ENG_EXTERNALTASKSENSOR",
+    )
+
     firefox_android_clients.set_upstream(wait_for_baseline_clients_daily)
 
     telemetry_derived__clients_first_seen_28_days_later__v1.set_upstream(
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py	2023-11-28 15:43:01.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py	2023-11-28 15:43:41.000000000 +0000
@@ -54,20 +54,6 @@
         depends_on_past=False,
     )
 
-    with TaskGroup(
-        "fenix_derived__new_profile_activation__v1_external"
-    ) as fenix_derived__new_profile_activation__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_fenix_derived__new_profile_activation__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_fenix_derived__new_profile_activation__v1",
-            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=79200)).isoformat() }}",
-        )
-
-        fenix_derived__new_profile_activation__v1_external.set_upstream(
-            fenix_derived__new_profile_activation__v1
-        )
-
     firefox_ios_derived__new_profile_activation__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__new_profile_activation__v1",
         destination_table="new_profile_activation_v1",
Only in /tmp/workspace/generated-sql/sql/: glam-fenix-dev
Only in /tmp/workspace/generated-sql/sql/: moz-fx-cjms-nonprod-9a36
Only in /tmp/workspace/generated-sql/sql/: moz-fx-cjms-prod-f3c7
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-bq-performance
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-experiments
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-marketing-prod
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-shared-prod
Only in /tmp/workspace/generated-sql/sql/: mozfun
Only in /tmp/workspace/main-generated-sql/sql/: sql
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Histogram Aggregates Metrics
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql	2023-11-28 15:38:53.000000000 +0000
@@ -0,0 +1,148 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_histogram_aggregates --source-table firefox_desktop_stable.metrics_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "metrics" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+histograms AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        "fog_ipc_buffer_sizes",
+        "memory_distribution",
+        metrics.memory_distribution.fog_ipc_buffer_sizes.values
+      ),
+      (
+        "fog_ipc_flush_durations",
+        "timing_distribution",
+        metrics.timing_distribution.fog_ipc_flush_durations.values
+      ),
+      (
+        "glean_database_size",
+        "memory_distribution",
+        metrics.memory_distribution.glean_database_size.values
+      ),
+      (
+        "glean_upload_discarded_exceeding_pings_size",
+        "memory_distribution",
+        metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size.values
+      ),
+      (
+        "glean_upload_pending_pings_directory_size",
+        "memory_distribution",
+        metrics.memory_distribution.glean_upload_pending_pings_directory_size.values
+      ),
+      (
+        "paint_build_displaylist_time",
+        "timing_distribution",
+        metrics.timing_distribution.paint_build_displaylist_time.values
+      )
+    ] AS metadata
+  FROM
+    extracted
+),
+flattened_histograms AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metadata.*
+  FROM
+    histograms,
+    UNNEST(metadata) AS metadata
+  WHERE
+    value IS NOT NULL
+),
+-- ARRAY_CONCAT_AGG may fail if the array of records exceeds 20 MB when
+-- serialized and shuffled. This may exhibit itself in a pathological case where
+-- the a single client sends *many* pings in a single day. However, this case
+-- has not been observed. If this does occur, each histogram should be unnested
+-- aggregated. This will force more shuffles and is inefficient. This may be
+-- mitigated by removing all of the empty entries which are sent to keep bucket
+-- ranges contiguous.
+--
+-- Tested via org_mozilla_fenix.metrics_v1 for 2020-02-23, unnest vs concat
+-- Slot consumed: 00:50:15 vs 00:06:45, Shuffled: 27.5GB vs 6.0 GB
+aggregated AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    mozfun.map.sum(ARRAY_CONCAT_AGG(value)) AS value
+  FROM
+    flattened_histograms
+  GROUP BY
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type
+)
+SELECT
+  sample_id,
+  client_id,
+  ping_type,
+  submission_date,
+  os,
+  app_version,
+  app_build_id,
+  channel,
+  ARRAY_AGG(
+    STRUCT<
+      metric STRING,
+      metric_type STRING,
+      key STRING,
+      agg_type STRING,
+      value ARRAY<STRUCT<key STRING, value INT64>>
+    >(metric, metric_type, '', 'summed_histogram', value)
+  ) AS histogram_aggregates
+FROM
+  aggregated
+GROUP BY
+  sample_id,
+  client_id,
+  ping_type,
+  submission_date,
+  os,
+  app_version,
+  app_build_id,
+  channel
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Baseline
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.baseline_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql	2023-11-28 15:38:52.000000000 +0000
@@ -0,0 +1,239 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.baseline_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "baseline" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.baseline_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'avg',
+        AVG(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'count',
+        IF(MIN(metrics.timespan.glean_baseline_duration.value) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'max',
+        MAX(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'min',
+        MIN(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'sum',
+        SUM(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_metrics_ping_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      )
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      ),
+      (
+        'glean_validation_pings_submitted',
+        'labeled_counter',
+        metrics.labeled_counter.glean_validation_pings_submitted
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Deletion Request
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.deletion_request_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql	2023-11-28 15:38:52.000000000 +0000
@@ -0,0 +1,164 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.deletion_request_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "deletion-request" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.deletion_request_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Events
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.events_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql	2023-11-28 15:38:52.000000000 +0000
@@ -0,0 +1,164 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.events_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "events" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.events_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Fog Validation
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.fog_validation_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql	2023-11-28 15:38:53.000000000 +0000
@@ -0,0 +1,178 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.fog_validation_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "fog-validation" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.fog_validation_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+      (
+        'fog_validation_profile_disk_is_ssd',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.fog_validation_profile_disk_is_ssd AS INT64))
+      ),
+      (
+        'fog_validation_profile_disk_is_ssd',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.fog_validation_profile_disk_is_ssd AS INT64))
+      )
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Metrics
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql	2023-11-28 15:38:52.000000000 +0000
@@ -0,0 +1,591 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.metrics_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "metrics" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+      (
+        'browser_ui_proton_enabled',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.browser_ui_proton_enabled AS INT64))
+      ),
+      (
+        'browser_ui_proton_enabled',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.browser_ui_proton_enabled AS INT64))
+      ),
+      (
+        'fog_failed_idle_registration',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.fog_failed_idle_registration AS INT64))
+      ),
+      (
+        'fog_failed_idle_registration',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.fog_failed_idle_registration AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'avg',
+        AVG(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'count',
+        IF(MIN(metrics.timespan.fog_initialization.value) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'max',
+        MAX(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'min',
+        MIN(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'sum',
+        SUM(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.fog_ipc_replay_failures) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'glean_core_migration_successful',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.glean_core_migration_successful AS INT64))
+      ),
+      (
+        'glean_core_migration_successful',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.glean_core_migration_successful AS INT64))
+      ),
+      ('glean_error_io', 'counter', '', 'avg', AVG(CAST(metrics.counter.glean_error_io AS INT64))),
+      (
+        'glean_error_io',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_error_io) IS NULL, NULL, COUNT(*))
+      ),
+      ('glean_error_io', 'counter', '', 'max', MAX(CAST(metrics.counter.glean_error_io AS INT64))),
+      ('glean_error_io', 'counter', '', 'min', MIN(CAST(metrics.counter.glean_error_io AS INT64))),
+      ('glean_error_io', 'counter', '', 'sum', SUM(CAST(metrics.counter.glean_error_io AS INT64))),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_error_preinit_tasks_overflow) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_timeout',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.glean_error_preinit_tasks_timeout AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_timeout',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.glean_error_preinit_tasks_timeout AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_time_invalid_timezone_offset) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_upload_deleted_pings_after_quota_hit) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_upload_pending_pings) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_app_forceclosed_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_baseline_ping_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_foreground_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.power_total_cpu_time_ms) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      )
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      ),
+      (
+        'glean_upload_ping_upload_failure',
+        'labeled_counter',
+        metrics.labeled_counter.glean_upload_ping_upload_failure
+      ),
+      (
+        'glean_validation_pings_submitted',
+        'labeled_counter',
+        metrics.labeled_counter.glean_validation_pings_submitted
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,5 @@
+
+# Generated by bigquery_etl.dependency
+references:
+  view.sql:
+  - glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_histogram_aggregates*
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql	2023-11-28 15:38:52.000000000 +0000
@@ -0,0 +1,10 @@
+-- view for firefox_desktop__view_clients_daily_histogram_aggregates_v1;
+-- View for histogram aggregates that handles time-partitioning
+CREATE OR REPLACE VIEW
+  `glam-fenix-dev.glam_etl.firefox_desktop__view_clients_daily_histogram_aggregates_v1`
+AS
+SELECT
+  * EXCEPT (submission_date),
+  DATE(_PARTITIONTIME) AS submission_date
+FROM
+  `glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_histogram_aggregates*`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,5 @@
+
+# Generated by bigquery_etl.dependency
+references:
+  view.sql:
+  - glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_scalar_aggregates*
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql	2023-11-28 15:38:52.000000000 +0000
@@ -0,0 +1,10 @@
+-- view for firefox_desktop__view_clients_daily_scalar_aggregates_v1;
+-- View to union daily scalar aggregates with date partitioning
+CREATE OR REPLACE VIEW
+  `glam-fenix-dev.glam_etl.firefox_desktop__view_clients_daily_scalar_aggregates_v1`
+AS
+SELECT
+  * EXCEPT (submission_date),
+  DATE(_PARTITIONTIME) AS submission_date
+FROM
+  `glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_scalar_aggregates*`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql	2023-11-28 15:38:53.000000000 +0000
@@ -0,0 +1,26 @@
+-- init for firefox_desktop_glam_nightly__clients_histogram_aggregates_v1;
+CREATE TABLE IF NOT EXISTS
+  `glam-fenix-dev.glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1`(
+    sample_id INT64,
+    client_id STRING,
+    ping_type STRING,
+    os STRING,
+    app_version INT64,
+    app_build_id STRING,
+    channel STRING,
+    histogram_aggregates ARRAY<
+      STRUCT<
+        metric STRING,
+        metric_type STRING,
+        key STRING,
+        agg_type STRING,
+        value ARRAY<STRUCT<key STRING, value INT64>>
+      >
+    >
+  )
+PARTITION BY
+  RANGE_BUCKET(sample_id, GENERATE_ARRAY(0, 100, 1))
+CLUSTER BY
+  app_version,
+  channel,
+  client_id
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml	2023-11-28 15:40:12.000000000 +0000
@@ -0,0 +1,15 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop Glam Nightly - Clients Histogram Aggregates
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  init.sql:
+  - glam-fenix-dev.glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1
+  query.sql:
+  - glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1
+  - glam_etl.firefox_desktop_glam_nightly__latest_versions_v1
+  - glam_etl.firefox_desktop_glam_nightly__view_clients_daily_histogram_aggregates_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql	2023-11-28 15:38:53.000000000 +0000
@@ -0,0 +1,212 @@
+-- query for firefox_desktop_glam_nightly__clients_histogram_aggregates_v1;
+CREATE TEMP FUNCTION udf_merged_user_data(aggs ANY TYPE)
+RETURNS ARRAY<
+  STRUCT<
+    metric STRING,
+    metric_type STRING,
+    key STRING,
+    agg_type STRING,
+    value ARRAY<STRUCT<key STRING, value INT64>>
+  >
+> AS (
+  (
+    WITH unnested AS (
+      SELECT
+        *
+      FROM
+        UNNEST(aggs)
+    ),
+    aggregated_data AS (
+      SELECT AS STRUCT
+        metric,
+        metric_type,
+        key,
+        agg_type,
+        mozfun.map.sum(ARRAY_CONCAT_AGG(value)) AS value
+      FROM
+        unnested
+      GROUP BY
+        metric,
+        metric_type,
+        key,
+        agg_type
+    )
+    SELECT
+      ARRAY_AGG((metric, metric_type, key, agg_type, value))
+    FROM
+      aggregated_data
+  )
+);
+
+CREATE TEMP FUNCTION filter_values(aggs ARRAY<STRUCT<key STRING, value INT64>>)
+RETURNS ARRAY<STRUCT<key STRING, value INT64>> AS (
+  ARRAY(
+    SELECT AS STRUCT
+      agg.key,
+      SUM(agg.value) AS value
+    FROM
+      UNNEST(aggs) agg
+    -- Prevent overflows by only keeping buckets where value is less than 2^40
+    -- allowing 2^24 entries. This value was chosen somewhat abitrarily, typically
+    -- the max histogram value is somewhere on the order of ~20 bits.
+    WHERE
+      agg.value <= POW(2, 40)
+    GROUP BY
+      agg.key
+  )
+);
+
+WITH extracted_accumulated AS (
+  SELECT
+    *
+  FROM
+    glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1
+  WHERE
+    sample_id >= @min_sample_id
+    AND sample_id <= @max_sample_id
+),
+filtered_accumulated AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    histogram_aggregates
+  FROM
+    extracted_accumulated
+  LEFT JOIN
+    glam_etl.firefox_desktop_glam_nightly__latest_versions_v1
+  USING
+    (channel)
+  WHERE
+      -- allow for builds to be slighly ahead of the current submission date, to
+      -- account for a reasonable amount of clock skew
+    mozfun.glam.build_hour_to_datetime(app_build_id) < DATE_ADD(@submission_date, INTERVAL 3 day)
+      -- only keep builds from the last year
+    AND mozfun.glam.build_hour_to_datetime(app_build_id) > DATE_SUB(
+      @submission_date,
+      INTERVAL 365 day
+    )
+    AND app_version > (latest_version - 3)
+),
+-- unnest the daily data
+extracted_daily AS (
+  SELECT
+    * EXCEPT (app_version, histogram_aggregates),
+    CAST(app_version AS INT64) AS app_version,
+    unnested_histogram_aggregates AS histogram_aggregates
+  FROM
+    glam_etl.firefox_desktop_glam_nightly__view_clients_daily_histogram_aggregates_v1,
+    UNNEST(histogram_aggregates) unnested_histogram_aggregates
+  WHERE
+    submission_date = @submission_date
+    AND value IS NOT NULL
+    AND ARRAY_LENGTH(value) > 0
+),
+filtered_daily AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    histogram_aggre

⚠️ Only part of the diff is displayed.

Link to full diff

@dataops-ci-bot
Copy link

Integration report for "removed fenix_derived.firefox_android_clients_v2 from shredder config"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py	2023-11-28 15:44:20.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py	2023-11-28 15:43:46.000000000 +0000
@@ -47,44 +47,6 @@
     doc_md=docs,
     tags=tags,
 ) as dag:
-    checks__fail_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__fail_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=True,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__warn_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=False,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     clients_first_seen_v2 = bigquery_etl_query(
         task_id="clients_first_seen_v2",
         destination_table="clients_first_seen_v2",
@@ -117,23 +79,6 @@
 
         clients_first_seen_v2_external.set_upstream(clients_first_seen_v2)
 
-    fenix_derived__firefox_android_clients__v2 = bigquery_etl_query(
-        task_id="fenix_derived__firefox_android_clients__v2",
-        destination_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        date_partition_parameter=None,
-        depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1 = bigquery_etl_query(
         task_id="fenix_derived__funnel_retention_clients_week_2__v1",
         destination_table="funnel_retention_clients_week_2_v1",
@@ -228,34 +173,6 @@
         parameters=["submission_date:DATE:{{ds}}"],
     )
 
-    wait_for_baseline_clients_daily = ExternalTaskSensor(
-        task_id="wait_for_baseline_clients_daily",
-        external_dag_id="copy_deduplicate",
-        external_task_id="baseline_clients_daily",
-        execution_delta=datetime.timedelta(seconds=3600),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -295,28 +212,6 @@
 
     clients_first_seen_v2.set_upstream(wait_for_telemetry_derived__clients_daily__v6)
 
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_copy_deduplicate_all
-    )
-    wait_for_fenix_derived__new_profile_activation__v1 = ExternalTaskSensor(
-        task_id="wait_for_fenix_derived__new_profile_activation__v1",
-        external_dag_id="bqetl_mobile_activation",
-        external_task_id="fenix_derived__new_profile_activation__v1",
-        execution_delta=datetime.timedelta(seconds=7200),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_fenix_derived__new_profile_activation__v1
-    )
-
     wait_for_baseline_clients_last_seen = ExternalTaskSensor(
         task_id="wait_for_baseline_clients_last_seen",
         external_dag_id="copy_deduplicate",
@@ -349,6 +244,18 @@
         fenix_derived__funnel_retention_clients_week_4__v1
     )
 
+    wait_for_baseline_clients_daily = ExternalTaskSensor(
+        task_id="wait_for_baseline_clients_daily",
+        external_dag_id="copy_deduplicate",
+        external_task_id="baseline_clients_daily",
+        execution_delta=datetime.timedelta(seconds=3600),
+        check_existence=True,
+        mode="reschedule",
+        allowed_states=ALLOWED_STATES,
+        failed_states=FAILED_STATES,
+        pool="DATA_ENG_EXTERNALTASKSENSOR",
+    )
+
     firefox_android_clients.set_upstream(wait_for_baseline_clients_daily)
 
     telemetry_derived__clients_first_seen_28_days_later__v1.set_upstream(
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py	2023-11-28 15:44:20.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py	2023-11-28 15:43:45.000000000 +0000
@@ -54,20 +54,6 @@
         depends_on_past=False,
     )
 
-    with TaskGroup(
-        "fenix_derived__new_profile_activation__v1_external"
-    ) as fenix_derived__new_profile_activation__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_fenix_derived__new_profile_activation__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_fenix_derived__new_profile_activation__v1",
-            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=79200)).isoformat() }}",
-        )
-
-        fenix_derived__new_profile_activation__v1_external.set_upstream(
-            fenix_derived__new_profile_activation__v1
-        )
-
     firefox_ios_derived__new_profile_activation__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__new_profile_activation__v1",
         destination_table="new_profile_activation_v1",
Only in /tmp/workspace/generated-sql/sql/: glam-fenix-dev
Only in /tmp/workspace/generated-sql/sql/: moz-fx-cjms-nonprod-9a36
Only in /tmp/workspace/generated-sql/sql/: moz-fx-cjms-prod-f3c7
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-bq-performance
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-experiments
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-marketing-prod
Only in /tmp/workspace/generated-sql/sql/: moz-fx-data-shared-prod
Only in /tmp/workspace/generated-sql/sql/: mozfun
Only in /tmp/workspace/main-generated-sql/sql/: sql
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Histogram Aggregates Metrics
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_histogram_aggregates_metrics_v1/query.sql	2023-11-28 15:39:50.000000000 +0000
@@ -0,0 +1,148 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_histogram_aggregates --source-table firefox_desktop_stable.metrics_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "metrics" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+histograms AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        "fog_ipc_buffer_sizes",
+        "memory_distribution",
+        metrics.memory_distribution.fog_ipc_buffer_sizes.values
+      ),
+      (
+        "fog_ipc_flush_durations",
+        "timing_distribution",
+        metrics.timing_distribution.fog_ipc_flush_durations.values
+      ),
+      (
+        "glean_database_size",
+        "memory_distribution",
+        metrics.memory_distribution.glean_database_size.values
+      ),
+      (
+        "glean_upload_discarded_exceeding_pings_size",
+        "memory_distribution",
+        metrics.memory_distribution.glean_upload_discarded_exceeding_pings_size.values
+      ),
+      (
+        "glean_upload_pending_pings_directory_size",
+        "memory_distribution",
+        metrics.memory_distribution.glean_upload_pending_pings_directory_size.values
+      ),
+      (
+        "paint_build_displaylist_time",
+        "timing_distribution",
+        metrics.timing_distribution.paint_build_displaylist_time.values
+      )
+    ] AS metadata
+  FROM
+    extracted
+),
+flattened_histograms AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metadata.*
+  FROM
+    histograms,
+    UNNEST(metadata) AS metadata
+  WHERE
+    value IS NOT NULL
+),
+-- ARRAY_CONCAT_AGG may fail if the array of records exceeds 20 MB when
+-- serialized and shuffled. This may exhibit itself in a pathological case where
+-- the a single client sends *many* pings in a single day. However, this case
+-- has not been observed. If this does occur, each histogram should be unnested
+-- aggregated. This will force more shuffles and is inefficient. This may be
+-- mitigated by removing all of the empty entries which are sent to keep bucket
+-- ranges contiguous.
+--
+-- Tested via org_mozilla_fenix.metrics_v1 for 2020-02-23, unnest vs concat
+-- Slot consumed: 00:50:15 vs 00:06:45, Shuffled: 27.5GB vs 6.0 GB
+aggregated AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    mozfun.map.sum(ARRAY_CONCAT_AGG(value)) AS value
+  FROM
+    flattened_histograms
+  GROUP BY
+    sample_id,
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type
+)
+SELECT
+  sample_id,
+  client_id,
+  ping_type,
+  submission_date,
+  os,
+  app_version,
+  app_build_id,
+  channel,
+  ARRAY_AGG(
+    STRUCT<
+      metric STRING,
+      metric_type STRING,
+      key STRING,
+      agg_type STRING,
+      value ARRAY<STRUCT<key STRING, value INT64>>
+    >(metric, metric_type, '', 'summed_histogram', value)
+  ) AS histogram_aggregates
+FROM
+  aggregated
+GROUP BY
+  sample_id,
+  client_id,
+  ping_type,
+  submission_date,
+  os,
+  app_version,
+  app_build_id,
+  channel
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Baseline
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.baseline_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_baseline_v1/query.sql	2023-11-28 15:39:51.000000000 +0000
@@ -0,0 +1,239 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.baseline_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "baseline" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.baseline_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'avg',
+        AVG(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'count',
+        IF(MIN(metrics.timespan.glean_baseline_duration.value) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'max',
+        MAX(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'min',
+        MIN(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_baseline_duration',
+        'timespan',
+        '',
+        'sum',
+        SUM(CAST(metrics.timespan.glean_baseline_duration.value AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_metrics_ping_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_metrics_ping_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_metrics_ping_count AS INT64))
+      )
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      ),
+      (
+        'glean_validation_pings_submitted',
+        'labeled_counter',
+        metrics.labeled_counter.glean_validation_pings_submitted
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Deletion Request
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.deletion_request_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_deletion_request_v1/query.sql	2023-11-28 15:39:51.000000000 +0000
@@ -0,0 +1,164 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.deletion_request_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "deletion-request" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.deletion_request_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Events
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.events_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_events_v1/query.sql	2023-11-28 15:39:50.000000000 +0000
@@ -0,0 +1,164 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.events_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "events" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.events_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Fog Validation
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.fog_validation_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_fog_validation_v1/query.sql	2023-11-28 15:39:50.000000000 +0000
@@ -0,0 +1,178 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.fog_validation_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "fog-validation" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.fog_validation_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+      (
+        'fog_validation_profile_disk_is_ssd',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.fog_validation_profile_disk_is_ssd AS INT64))
+      ),
+      (
+        'fog_validation_profile_disk_is_ssd',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.fog_validation_profile_disk_is_ssd AS INT64))
+      )
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,11 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop - Clients Daily Scalar Aggregates Metrics
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  query.sql:
+  - moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__clients_daily_scalar_aggregates_metrics_v1/query.sql	2023-11-28 15:39:51.000000000 +0000
@@ -0,0 +1,591 @@
+-- Query generated by: python3 -m bigquery_etl.glam.clients_daily_scalar_aggregates --source-table firefox_desktop_stable.metrics_v1
+WITH extracted AS (
+  SELECT
+    *,
+    DATE(submission_timestamp) AS submission_date,
+    client_info.client_id,
+    "metrics" AS ping_type,
+    COALESCE(
+      SAFE_CAST(SPLIT(client_info.app_display_version, '.')[OFFSET(0)] AS INT64),
+      0
+    ) AS app_version,
+    client_info.os AS os,
+    client_info.app_build AS app_build_id,
+    client_info.app_channel AS channel
+  FROM
+    `moz-fx-data-shared-prod.firefox_desktop_stable.metrics_v1`
+  WHERE
+    DATE(submission_timestamp) = @submission_date
+    AND client_info.client_id IS NOT NULL
+),
+unlabeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+      (
+        'browser_ui_proton_enabled',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.browser_ui_proton_enabled AS INT64))
+      ),
+      (
+        'browser_ui_proton_enabled',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.browser_ui_proton_enabled AS INT64))
+      ),
+      (
+        'fog_failed_idle_registration',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.fog_failed_idle_registration AS INT64))
+      ),
+      (
+        'fog_failed_idle_registration',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.fog_failed_idle_registration AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'avg',
+        AVG(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'count',
+        IF(MIN(metrics.timespan.fog_initialization.value) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'max',
+        MAX(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'min',
+        MIN(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_initialization',
+        'timespan',
+        '',
+        'sum',
+        SUM(CAST(metrics.timespan.fog_initialization.value AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.fog_ipc_replay_failures) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'fog_ipc_replay_failures',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.fog_ipc_replay_failures AS INT64))
+      ),
+      (
+        'glean_core_migration_successful',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.glean_core_migration_successful AS INT64))
+      ),
+      (
+        'glean_core_migration_successful',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.glean_core_migration_successful AS INT64))
+      ),
+      ('glean_error_io', 'counter', '', 'avg', AVG(CAST(metrics.counter.glean_error_io AS INT64))),
+      (
+        'glean_error_io',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_error_io) IS NULL, NULL, COUNT(*))
+      ),
+      ('glean_error_io', 'counter', '', 'max', MAX(CAST(metrics.counter.glean_error_io AS INT64))),
+      ('glean_error_io', 'counter', '', 'min', MIN(CAST(metrics.counter.glean_error_io AS INT64))),
+      ('glean_error_io', 'counter', '', 'sum', SUM(CAST(metrics.counter.glean_error_io AS INT64))),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_error_preinit_tasks_overflow) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_overflow',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_error_preinit_tasks_overflow AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_timeout',
+        'boolean',
+        '',
+        'false',
+        SUM(CAST(NOT metrics.boolean.glean_error_preinit_tasks_timeout AS INT64))
+      ),
+      (
+        'glean_error_preinit_tasks_timeout',
+        'boolean',
+        '',
+        'true',
+        SUM(CAST(metrics.boolean.glean_error_preinit_tasks_timeout AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_time_invalid_timezone_offset) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_time_invalid_timezone_offset',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_time_invalid_timezone_offset AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_upload_deleted_pings_after_quota_hit) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_deleted_pings_after_quota_hit',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_upload_deleted_pings_after_quota_hit AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_upload_pending_pings) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_upload_pending_pings',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_upload_pending_pings AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_app_forceclosed_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_app_forceclosed_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_app_forceclosed_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_baseline_ping_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_baseline_ping_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_baseline_ping_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.glean_validation_foreground_count) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'glean_validation_foreground_count',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.glean_validation_foreground_count AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'avg',
+        AVG(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'count',
+        IF(MIN(metrics.counter.power_total_cpu_time_ms) IS NULL, NULL, COUNT(*))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'max',
+        MAX(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'min',
+        MIN(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      ),
+      (
+        'power_total_cpu_time_ms',
+        'counter',
+        '',
+        'sum',
+        SUM(CAST(metrics.counter.power_total_cpu_time_ms AS INT64))
+      )
+    ] AS scalar_aggregates
+  FROM
+    extracted
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+),
+grouped_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY<STRUCT<name STRING, type STRING, value ARRAY<STRUCT<key STRING, value INT64>>>>[
+      (
+        'glean_error_invalid_label',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_label
+      ),
+      (
+        'glean_error_invalid_overflow',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_overflow
+      ),
+      (
+        'glean_error_invalid_state',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_state
+      ),
+      (
+        'glean_error_invalid_value',
+        'labeled_counter',
+        metrics.labeled_counter.glean_error_invalid_value
+      ),
+      (
+        'glean_upload_ping_upload_failure',
+        'labeled_counter',
+        metrics.labeled_counter.glean_upload_ping_upload_failure
+      ),
+      (
+        'glean_validation_pings_submitted',
+        'labeled_counter',
+        metrics.labeled_counter.glean_validation_pings_submitted
+      )
+    ] AS metrics
+  FROM
+    extracted
+),
+flattened_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metrics.name AS metric,
+    metrics.type AS metric_type,
+    value.key AS key,
+    value.value AS value
+  FROM
+    grouped_labeled_metrics
+  CROSS JOIN
+    UNNEST(metrics) AS metrics,
+    UNNEST(metrics.value) AS value
+),
+aggregated_labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key,
+    MAX(value) AS max,
+    MIN(value) AS min,
+    AVG(value) AS avg,
+    SUM(value) AS sum,
+    IF(MIN(value) IS NULL, NULL, COUNT(*)) AS count
+  FROM
+    flattened_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    metric,
+    metric_type,
+    key
+),
+labeled_metrics AS (
+  SELECT
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    ARRAY_CONCAT_AGG(
+      ARRAY<STRUCT<metric STRING, metric_type STRING, key STRING, agg_type STRING, value FLOAT64>>[
+        (metric, metric_type, key, 'max', max),
+        (metric, metric_type, key, 'min', min),
+        (metric, metric_type, key, 'avg', avg),
+        (metric, metric_type, key, 'sum', sum),
+        (metric, metric_type, key, 'count', count)
+      ]
+    ) AS scalar_aggregates
+  FROM
+    aggregated_labeled_metrics
+  GROUP BY
+    client_id,
+    ping_type,
+    submission_date,
+    os,
+    app_version,
+    app_build_id,
+    channel
+)
+SELECT
+  *
+FROM
+  unlabeled_metrics
+UNION ALL
+SELECT
+  *
+FROM
+  labeled_metrics
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,5 @@
+
+# Generated by bigquery_etl.dependency
+references:
+  view.sql:
+  - glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_histogram_aggregates*
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_histogram_aggregates_v1/view.sql	2023-11-28 15:39:51.000000000 +0000
@@ -0,0 +1,10 @@
+-- view for firefox_desktop__view_clients_daily_histogram_aggregates_v1;
+-- View for histogram aggregates that handles time-partitioning
+CREATE OR REPLACE VIEW
+  `glam-fenix-dev.glam_etl.firefox_desktop__view_clients_daily_histogram_aggregates_v1`
+AS
+SELECT
+  * EXCEPT (submission_date),
+  DATE(_PARTITIONTIME) AS submission_date
+FROM
+  `glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_histogram_aggregates*`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,5 @@
+
+# Generated by bigquery_etl.dependency
+references:
+  view.sql:
+  - glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_scalar_aggregates*
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop__view_clients_daily_scalar_aggregates_v1/view.sql	2023-11-28 15:39:50.000000000 +0000
@@ -0,0 +1,10 @@
+-- view for firefox_desktop__view_clients_daily_scalar_aggregates_v1;
+-- View to union daily scalar aggregates with date partitioning
+CREATE OR REPLACE VIEW
+  `glam-fenix-dev.glam_etl.firefox_desktop__view_clients_daily_scalar_aggregates_v1`
+AS
+SELECT
+  * EXCEPT (submission_date),
+  DATE(_PARTITIONTIME) AS submission_date
+FROM
+  `glam-fenix-dev.glam_etl.firefox_desktop__clients_daily_scalar_aggregates*`
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/init.sql	2023-11-28 15:39:50.000000000 +0000
@@ -0,0 +1,26 @@
+-- init for firefox_desktop_glam_nightly__clients_histogram_aggregates_v1;
+CREATE TABLE IF NOT EXISTS
+  `glam-fenix-dev.glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1`(
+    sample_id INT64,
+    client_id STRING,
+    ping_type STRING,
+    os STRING,
+    app_version INT64,
+    app_build_id STRING,
+    channel STRING,
+    histogram_aggregates ARRAY<
+      STRUCT<
+        metric STRING,
+        metric_type STRING,
+        key STRING,
+        agg_type STRING,
+        value ARRAY<STRUCT<key STRING, value INT64>>
+      >
+    >
+  )
+PARTITION BY
+  RANGE_BUCKET(sample_id, GENERATE_ARRAY(0, 100, 1))
+CLUSTER BY
+  app_version,
+  channel,
+  client_id
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/metadata.yaml	2023-11-28 15:39:54.000000000 +0000
@@ -0,0 +1,15 @@
+friendly_name: |-
+  Glam Etl - Firefox Desktop Glam Nightly - Clients Histogram Aggregates
+description: |-
+  [DESCRIPTION_MISSING]
+owners:
+- efilho@mozilla.com
+
+# Generated by bigquery_etl.dependency
+references:
+  init.sql:
+  - glam-fenix-dev.glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1
+  query.sql:
+  - glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1
+  - glam_etl.firefox_desktop_glam_nightly__latest_versions_v1
+  - glam_etl.firefox_desktop_glam_nightly__view_clients_daily_histogram_aggregates_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql
--- /tmp/workspace/main-generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/glam-fenix-dev/glam_etl/firefox_desktop_glam_nightly__clients_histogram_aggregates_v1/query.sql	2023-11-28 15:39:50.000000000 +0000
@@ -0,0 +1,212 @@
+-- query for firefox_desktop_glam_nightly__clients_histogram_aggregates_v1;
+CREATE TEMP FUNCTION udf_merged_user_data(aggs ANY TYPE)
+RETURNS ARRAY<
+  STRUCT<
+    metric STRING,
+    metric_type STRING,
+    key STRING,
+    agg_type STRING,
+    value ARRAY<STRUCT<key STRING, value INT64>>
+  >
+> AS (
+  (
+    WITH unnested AS (
+      SELECT
+        *
+      FROM
+        UNNEST(aggs)
+    ),
+    aggregated_data AS (
+      SELECT AS STRUCT
+        metric,
+        metric_type,
+        key,
+        agg_type,
+        mozfun.map.sum(ARRAY_CONCAT_AGG(value)) AS value
+      FROM
+        unnested
+      GROUP BY
+        metric,
+        metric_type,
+        key,
+        agg_type
+    )
+    SELECT
+      ARRAY_AGG((metric, metric_type, key, agg_type, value))
+    FROM
+      aggregated_data
+  )
+);
+
+CREATE TEMP FUNCTION filter_values(aggs ARRAY<STRUCT<key STRING, value INT64>>)
+RETURNS ARRAY<STRUCT<key STRING, value INT64>> AS (
+  ARRAY(
+    SELECT AS STRUCT
+      agg.key,
+      SUM(agg.value) AS value
+    FROM
+      UNNEST(aggs) agg
+    -- Prevent overflows by only keeping buckets where value is less than 2^40
+    -- allowing 2^24 entries. This value was chosen somewhat abitrarily, typically
+    -- the max histogram value is somewhere on the order of ~20 bits.
+    WHERE
+      agg.value <= POW(2, 40)
+    GROUP BY
+      agg.key
+  )
+);
+
+WITH extracted_accumulated AS (
+  SELECT
+    *
+  FROM
+    glam_etl.firefox_desktop_glam_nightly__clients_histogram_aggregates_v1
+  WHERE
+    sample_id >= @min_sample_id
+    AND sample_id <= @max_sample_id
+),
+filtered_accumulated AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    histogram_aggregates
+  FROM
+    extracted_accumulated
+  LEFT JOIN
+    glam_etl.firefox_desktop_glam_nightly__latest_versions_v1
+  USING
+    (channel)
+  WHERE
+      -- allow for builds to be slighly ahead of the current submission date, to
+      -- account for a reasonable amount of clock skew
+    mozfun.glam.build_hour_to_datetime(app_build_id) < DATE_ADD(@submission_date, INTERVAL 3 day)
+      -- only keep builds from the last year
+    AND mozfun.glam.build_hour_to_datetime(app_build_id) > DATE_SUB(
+      @submission_date,
+      INTERVAL 365 day
+    )
+    AND app_version > (latest_version - 3)
+),
+-- unnest the daily data
+extracted_daily AS (
+  SELECT
+    * EXCEPT (app_version, histogram_aggregates),
+    CAST(app_version AS INT64) AS app_version,
+    unnested_histogram_aggregates AS histogram_aggregates
+  FROM
+    glam_etl.firefox_desktop_glam_nightly__view_clients_daily_histogram_aggregates_v1,
+    UNNEST(histogram_aggregates) unnested_histogram_aggregates
+  WHERE
+    submission_date = @submission_date
+    AND value IS NOT NULL
+    AND ARRAY_LENGTH(value) > 0
+),
+filtered_daily AS (
+  SELECT
+    sample_id,
+    client_id,
+    ping_type,
+    os,
+    app_version,
+    app_build_id,
+    channel,
+    histogram_aggre

⚠️ Only part of the diff is displayed.

Link to full diff

Copy link
Contributor

@lucia-vargas-a lucia-vargas-a left a comment

Choose a reason for hiding this comment

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

Hi Kik, for reference and understanding, could you please add in the description why the decision to remove the table? or a link to the Jira task?

@kik-kik kik-kik changed the title feat(): deleting fenix_derived/firefox_android_clients_v2, v1 will remains the active model feat(DENG-1774 / cancelled): deleting fenix_derived/firefox_android_clients_v2, v1 will remains the active model Nov 29, 2023
@kik-kik kik-kik force-pushed the feat/removing-fenix_derived-firefox-android-clients-v2 branch from 00dec03 to 7c16ed3 Compare November 29, 2023 14:20
@lucia-vargas-a
Copy link
Contributor

lucia-vargas-a commented Nov 29, 2023

Ideally in the description it's described what problems arised that required removing the table, and if this work will continue in a separate PR.

@dataops-ci-bot
Copy link

Integration report for "removed fenix_derived.firefox_android_clients_v2 from shredder config"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py	2023-11-29 14:44:41.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py	2023-11-29 14:42:42.000000000 +0000
@@ -79,25 +79,6 @@
             checks__fail_fenix_derived__firefox_android_clients__v1
         )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__fail_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=True,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1 = bigquery_dq_check(
         task_id="checks__warn_fenix_derived__firefox_android_clients__v1",
         source_table="firefox_android_clients_v1",
@@ -116,25 +97,6 @@
         retries=0,
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__warn_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=False,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     clients_first_seen_v2 = bigquery_etl_query(
         task_id="clients_first_seen_v2",
         destination_table="clients_first_seen_v2",
@@ -167,23 +129,6 @@
 
         clients_first_seen_v2_external.set_upstream(clients_first_seen_v2)
 
-    fenix_derived__firefox_android_clients__v2 = bigquery_etl_query(
-        task_id="fenix_derived__firefox_android_clients__v2",
-        destination_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        date_partition_parameter=None,
-        depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1 = bigquery_etl_query(
         task_id="fenix_derived__funnel_retention_clients_week_2__v1",
         destination_table="funnel_retention_clients_week_2_v1",
@@ -286,14 +231,6 @@
         firefox_android_clients
     )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1.set_upstream(
         wait_for_baseline_clients_daily
     )
@@ -302,14 +239,6 @@
         firefox_android_clients
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -349,28 +278,6 @@
 
     clients_first_seen_v2.set_upstream(wait_for_telemetry_derived__clients_daily__v6)
 
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_copy_deduplicate_all
-    )
-    wait_for_fenix_derived__new_profile_activation__v1 = ExternalTaskSensor(
-        task_id="wait_for_fenix_derived__new_profile_activation__v1",
-        external_dag_id="bqetl_mobile_activation",
-        external_task_id="fenix_derived__new_profile_activation__v1",
-        execution_delta=datetime.timedelta(seconds=7200),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_fenix_derived__new_profile_activation__v1
-    )
-
     wait_for_baseline_clients_last_seen = ExternalTaskSensor(
         task_id="wait_for_baseline_clients_last_seen",
         external_dag_id="copy_deduplicate",
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py	2023-11-29 14:44:41.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py	2023-11-29 14:42:42.000000000 +0000
@@ -54,20 +54,6 @@
         depends_on_past=False,
     )
 
-    with TaskGroup(
-        "fenix_derived__new_profile_activation__v1_external"
-    ) as fenix_derived__new_profile_activation__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_fenix_derived__new_profile_activation__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_fenix_derived__new_profile_activation__v1",
-            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=79200)).isoformat() }}",
-        )
-
-        fenix_derived__new_profile_activation__v1_external.set_upstream(
-            fenix_derived__new_profile_activation__v1
-        )
-
     firefox_ios_derived__new_profile_activation__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__new_profile_activation__v1",
         destination_table="new_profile_activation_v1",
Only in /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived: firefox_android_clients_v2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	2023-11-29 14:43:43.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,104 +0,0 @@
-
--- TODO: convert is_unique to fail after duplication is resolved.
-#warn
-WITH non_unique AS (
-  SELECT
-    COUNT(*) AS total_count
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  GROUP BY
-    client_id
-  HAVING
-    total_count > 1
-)
-SELECT
-  IF(
-    (SELECT COUNT(*) FROM non_unique) > 0,
-    ERROR(
-      "Duplicates detected (Expected combined set of values for columns ['client_id'] to be unique.)"
-    ),
-    NULL
-  );
-
-#fail
-WITH null_checks AS (
-  SELECT
-    [
-      IF(COUNTIF(client_id IS NULL) > 0, "client_id", NULL),
-      IF(COUNTIF(sample_id IS NULL) > 0, "sample_id", NULL)
-    ] AS checks
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-),
-non_null_checks AS (
-  SELECT
-    ARRAY_AGG(u IGNORE NULLS) AS checks
-  FROM
-    null_checks,
-    UNNEST(checks) AS u
-)
-SELECT
-  IF(
-    (SELECT ARRAY_LENGTH(checks) FROM non_null_checks) > 0,
-    ERROR(
-      CONCAT(
-        "Columns with NULL values: ",
-        (SELECT ARRAY_TO_STRING(checks, ", ") FROM non_null_checks)
-      )
-    ),
-    NULL
-  );
-
-#fail
-WITH min_row_count AS (
-  SELECT
-    COUNT(*) AS total_rows
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-)
-SELECT
-  IF(
-    (SELECT COUNTIF(total_rows < 1) FROM min_row_count) > 0,
-    ERROR(
-      CONCAT(
-        "Min Row Count Error: ",
-        (SELECT total_rows FROM min_row_count),
-        " rows found, expected more than 1 rows"
-      )
-    ),
-    NULL
-  );
-
-#warn
-WITH base AS (
-  SELECT
-    COUNTIF(is_activated)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-),
-upstream AS (
-  SELECT
-    COUNTIF(activated = 1)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.new_profile_activation_v1`
-  WHERE
-    first_seen_date = @submission_date
-    AND submission_date = DATE_SUB(@submission_date, INTERVAL 6 DAY)
-)
-SELECT
-  IF(
-    (SELECT * FROM base) <> (SELECT * FROM upstream),
-    ERROR(
-      CONCAT(
-        "Number of activations does not match up that of the upstream table. Upstream count: ",
-        (SELECT * FROM upstream),
-        ", base count: ",
-        (SELECT * FROM base)
-      )
-    ),
-    NULL
-  );
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	2023-11-29 14:43:43.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,57 +0,0 @@
-friendly_name: Firefox Android Clients
-description: |-
-  First observations for Firefox Android clients of channel Release,
-  retrieved from the earliest pings: baseline, first_session and metrics.
-  The attributes stored in this table include the first attribution,
-  device, OS and ISP details.
-
-  This table should be accessed through the user-facing view
-  `fenix.firefox_android_clients`.
-
-  For analysis purposes, use first_seen_date to query clients that
-  effectively appeared on that date. The submission_date indicates
-  when the server received the data.
-
-  The query for this table overwrites the whole table instead of writing to
-  a single partition, so manual backfills must use parameter --no_partition.
-
-  Proposal:
-  https://docs.google.com/document/d/12bj4DhCybelqHVgOVq8KJlzgtbbUw3f68palNrv-gaM/.
-
-  For more details about attribution and campaign structure see:
-  https://help.adjust.com/en/article/tracker-urls#campaign-structure-parameters.
-owners:
-- kik@mozilla.com
-labels:
-  application: firefox_android
-  incremental: true
-  schedule: daily
-  owner1: kik
-  dag: bqetl_analytics_tables
-scheduling:
-  dag_name: bqetl_analytics_tables
-  depends_on_past: true
-  date_partition_parameter: null
-  parameters:
-  - submission_date:DATE:{{ds}}
-  depends_on:
-  - task_id: baseline_clients_daily
-    dag_name: copy_deduplicate
-    execution_delta: 1h
-bigquery:
-  time_partitioning:
-    type: day
-    field: first_seen_date
-    require_partition_filter: false
-    expiration_days: null
-  clustering:
-    fields:
-    - sample_id
-    - channel
-    - first_reported_country
-workgroup_access:
-- role: roles/bigquery.dataViewer
-  members:
-  - workgroup:mozilla-confidential
-references: {}
-deprecated: false
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	2023-11-29 14:43:43.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,237 +0,0 @@
--- Query first observations for Firefox Android Clients.
-WITH baseline_first_seen AS (
-  SELECT
-    client_id,
-    submission_date,
-    first_seen_date,
-    sample_id,
-    country AS first_reported_country,
-    isp AS first_reported_isp,
-    normalized_channel AS channel,
-    device_manufacturer,
-    device_model,
-    normalized_os_version AS os_version,
-    app_display_version AS app_version,
-    DATETIME(first_run_date) AS first_run_datetime,
-    locale,
-  FROM
-    fenix.baseline_clients_first_seen
-  WHERE
-    submission_date = @submission_date
-    AND client_id IS NOT NULL
-),
-activations AS (
-  SELECT
-    client_id,
-    CAST(activated AS BOOLEAN) AS is_activated,
-  FROM
-    fenix.new_profile_activation
-  WHERE
-    submission_date = @submission_date
-),
--- Find earliest data per client from the first_session ping.
-first_session_ping_base AS (
-  SELECT
-    client_info.client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(metrics.string.first_session_adgroup, "") AS adjust_ad_group,
-    NULLIF(metrics.string.first_session_campaign, "") AS adjust_campaign,
-    NULLIF(metrics.string.first_session_creative, "") AS adjust_creative,
-    NULLIF(metrics.string.first_session_network, "") AS adjust_network,
-  FROM
-    fenix.first_session
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-first_session_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-  FROM
-    first_session_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
--- Find earliest data per client from the metrics ping.
-metrics_ping_base AS (
-  SELECT
-    client_info.client_id AS client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_ad_group, "") AS adjust_ad_group,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_campaign, "") AS adjust_campaign,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_creative, "") AS adjust_creative,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_network, "") AS adjust_network,
-    NULLIF(fenix_metrics.metrics.string.metrics_install_source, "") AS install_source,
-  FROM
-    fenix.metrics AS fenix_metrics
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-metrics_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-    ARRAY_AGG(install_source IGNORE NULLS ORDER BY submission_timestamp ASC)[
-      SAFE_OFFSET(0)
-    ] AS install_source,
-  FROM
-    metrics_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
-_current AS (
-  SELECT
-    client_id,
-    sample_id,
-    first_seen_date,
-    first_reported_country,
-    first_reported_isp,
-    channel,
-    device_manufacturer,
-    device_model,
-    os_version,
-    app_version,
-    locale,
-    COALESCE(first_session.adjust_info, metrics.adjust_info) AS adjust_info,
-    metrics.install_source,
-    STRUCT(
-      IF(baseline_first_seen.client_id IS NULL, FALSE, TRUE) AS reported_baseline_ping,
-      IF(first_session.client_id IS NULL, FALSE, TRUE) AS reported_first_session_ping,
-      IF(metrics.client_id IS NULL, FALSE, TRUE) AS reported_metrics_ping,
-      CASE
-        WHEN first_session.adjust_info IS NOT NULL
-          THEN "first_session"
-        WHEN metrics.adjust_info IS NOT NULL
-          THEN "metrics"
-        ELSE NULL
-      END AS adjust_info__source_ping
-    ) AS metadata,
-  FROM
-    baseline_first_seen
-  FULL OUTER JOIN
-    first_session_ping AS first_session
-  USING
-    (client_id, sample_id)
-  FULL OUTER JOIN
-    metrics_ping AS metrics
-  USING
-    (client_id, sample_id)
-  WHERE
-    client_id IS NOT NULL
-),
-_previous AS (
-  SELECT
-    *
-  FROM
-    fenix_derived.firefox_android_clients_v2
-)
-SELECT
-  client_id,
-  sample_id,
-  COALESCE(_previous.first_seen_date, _current.first_seen_date) AS first_seen_date,
-  COALESCE(
-    _previous.first_reported_country,
-    _current.first_reported_country
-  ) AS first_reported_country,
-  COALESCE(_previous.first_reported_isp, _current.first_reported_isp) AS first_reported_isp,
-  COALESCE(_previous.channel, _current.channel) AS channel,
-  COALESCE(_previous.device_manufacturer, _current.device_manufacturer) AS device_manufacturer,
-  COALESCE(_previous.device_model, _current.device_model) AS device_model,
-  COALESCE(_previous.os_version, _current.os_version) AS os_version,
-  COALESCE(_previous.app_version, _current.app_version) AS app_version,
-  COALESCE(_previous.locale, _current.locale) AS locale,
-  activations.is_activated,
-  -- below is to avoid mix and matching different adjust attributes
-  -- from different records. This way we always treat them as a single "unit"
-  IF(
-    _previous.adjust_ad_group IS NULL
-    AND _previous.adjust_campaign IS NULL
-    AND _previous.adjust_creative IS NULL
-    AND _previous.adjust_network IS NULL,
-    _current.adjust_info,
-    STRUCT(
-      _previous.submission_timestamp,
-      _previous.adjust_ad_group,
-      _previous.adjust_campaign,
-      _previous.adjust_creative,
-      _previous.adjust_network
-    )
-  ).*,
-  COALESCE(_previous.install_source, _current.install_source) AS install_source,
-  STRUCT(
-    COALESCE(
-      _previous.metadata.reported_baseline_ping
-      OR _current.metadata.reported_baseline_ping,
-      FALSE
-    ) AS reported_baseline_ping,
-    COALESCE(
-      _previous.metadata.reported_first_session_ping
-      OR _current.metadata.reported_first_session_ping,
-      FALSE
-    ) AS reported_first_session_ping,
-    COALESCE(
-      _previous.metadata.reported_metrics_ping
-      OR _current.metadata.reported_metrics_ping,
-      FALSE
-    ) AS reported_metrics_ping,
-    COALESCE(
-      _previous.metadata.adjust_info__source_ping,
-      _current.metadata.adjust_info__source_ping
-    ) AS adjust_info__source_ping
-  ) AS metadata,
-FROM
-  _current
-FULL OUTER JOIN
-  _previous
-USING
-  (client_id, sample_id)
-LEFT JOIN
-  activations
-USING
-  (client_id)
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	2023-11-29 14:43:43.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,140 +0,0 @@
-fields:
-
-- mode: NULLABLE
-  name: client_id
-  type: STRING
-  description: |
-    Unique ID for the client installation.
-
-- mode: NULLABLE
-  name: sample_id
-  type: INTEGER
-  description: |
-    Sample ID to limit query results during an analysis.
-
-- mode: NULLABLE
-  name: first_seen_date
-  type: DATE
-  description: |
-    Date when the app first reported a baseline ping for the client.
-
-- mode: NULLABLE
-  name: first_reported_country
-  type: STRING
-  description: |
-    First reported country for the client installation.
-
-- mode: NULLABLE
-  name: first_reported_isp
-  type: STRING
-  description: |
-    Name of the first reported isp (Internet Service Provider).
-
-- mode: NULLABLE
-  name: channel
-  type: STRING
-  description: |
-    Channel where the browser is released.
-
-- mode: NULLABLE
-  name: device_manufacturer
-  type: STRING
-  description: |
-    Manufacturer of the device where the client is installed.
-
-- mode: NULLABLE
-  name: device_model
-  type: STRING
-  description: |
-    Model of the device where the client is installed.
-
-- mode: NULLABLE
-  name: os_version
-  type: STRING
-  description: |
-    Version of the Operating System where the client is originally installed.
-
-- mode: NULLABLE
-  name: app_version
-  type: STRING
-  description: |
-    App display version for this client installation.
-
-- mode: NULLABLE
-  name: locale
-  type: STRING
-  description: |
-    Client's initial locale.
-
-- mode: NULLABLE
-  name: is_activated
-  type: BOOLEAN
-  description: |
-    Determines if a client is activated based on the activation metric and a 7 day lag.
-
-- mode: NULLABLE
-  name: submission_timestamp
-  type: TIMESTAMP
-  description: |
-    Timestamp of the ping which contained the adjust information.
-
-- mode: NULLABLE
-  name: adjust_ad_group
-  type: STRING
-  description: |
-    Structure parameter for the the ad group of a campaign.
-
-- mode: NULLABLE
-  name: adjust_campaign
-  type: STRING
-  description: |
-    Structure parameter for the campaign name.
-
-- mode: NULLABLE
-  name: adjust_creative
-  type: STRING
-  description: |
-    Structure parameter for the creative content of a campaign.
-
-- mode: NULLABLE
-  name: adjust_network
-  type: STRING
-  description: |
-    The type of source of a client installation.
-
-- mode: NULLABLE
-  name: install_source
-  type: STRING
-  description: |
-    This value is only sourced from the metrics ping.
-
-- mode: NULLABLE
-  name: metadata
-  type: RECORD
-  description: |
-    Additional context around the source of this record.
-
-  fields:
-  - mode: NULLABLE
-    name: reported_baseline_ping
-    type: BOOLEAN
-    description: |
-      True if the client reported a baseline_clients_first_seen ping.
-
-  - mode: NULLABLE
-    name: reported_first_session_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a first_session ping.
-
-  - mode: NULLABLE
-    name: reported_metrics_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a metrics ping.
-
-  - mode: NULLABLE
-    name: adjust_info__source_ping
-    type: STRING
-    description: |
-      Ping from which the adjust_info values originate.

Link to full diff

@kik-kik kik-kik force-pushed the feat/removing-fenix_derived-firefox-android-clients-v2 branch from 7c16ed3 to 0008e13 Compare November 29, 2023 15:45
@dataops-ci-bot
Copy link

Integration report for "removed fenix_derived.firefox_android_clients_v2 from shredder config"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py	2023-11-29 16:08:53.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py	2023-11-29 16:08:02.000000000 +0000
@@ -79,25 +79,6 @@
             checks__fail_fenix_derived__firefox_android_clients__v1
         )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__fail_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=True,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1 = bigquery_dq_check(
         task_id="checks__warn_fenix_derived__firefox_android_clients__v1",
         source_table="firefox_android_clients_v1",
@@ -116,25 +97,6 @@
         retries=0,
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__warn_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=False,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     clients_first_seen_v2 = bigquery_etl_query(
         task_id="clients_first_seen_v2",
         destination_table="clients_first_seen_v2",
@@ -167,23 +129,6 @@
 
         clients_first_seen_v2_external.set_upstream(clients_first_seen_v2)
 
-    fenix_derived__firefox_android_clients__v2 = bigquery_etl_query(
-        task_id="fenix_derived__firefox_android_clients__v2",
-        destination_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        date_partition_parameter=None,
-        depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1 = bigquery_etl_query(
         task_id="fenix_derived__funnel_retention_clients_week_2__v1",
         destination_table="funnel_retention_clients_week_2_v1",
@@ -286,14 +231,6 @@
         firefox_android_clients
     )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1.set_upstream(
         wait_for_baseline_clients_daily
     )
@@ -302,14 +239,6 @@
         firefox_android_clients
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -349,28 +278,6 @@
 
     clients_first_seen_v2.set_upstream(wait_for_telemetry_derived__clients_daily__v6)
 
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_copy_deduplicate_all
-    )
-    wait_for_fenix_derived__new_profile_activation__v1 = ExternalTaskSensor(
-        task_id="wait_for_fenix_derived__new_profile_activation__v1",
-        external_dag_id="bqetl_mobile_activation",
-        external_task_id="fenix_derived__new_profile_activation__v1",
-        execution_delta=datetime.timedelta(seconds=7200),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_fenix_derived__new_profile_activation__v1
-    )
-
     wait_for_baseline_clients_last_seen = ExternalTaskSensor(
         task_id="wait_for_baseline_clients_last_seen",
         external_dag_id="copy_deduplicate",
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py	2023-11-29 16:08:52.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py	2023-11-29 16:08:01.000000000 +0000
@@ -54,20 +54,6 @@
         depends_on_past=False,
     )
 
-    with TaskGroup(
-        "fenix_derived__new_profile_activation__v1_external"
-    ) as fenix_derived__new_profile_activation__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_fenix_derived__new_profile_activation__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_fenix_derived__new_profile_activation__v1",
-            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=79200)).isoformat() }}",
-        )
-
-        fenix_derived__new_profile_activation__v1_external.set_upstream(
-            fenix_derived__new_profile_activation__v1
-        )
-
     firefox_ios_derived__new_profile_activation__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__new_profile_activation__v1",
         destination_table="new_profile_activation_v1",
Only in /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived: firefox_android_clients_v2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,104 +0,0 @@
-
--- TODO: convert is_unique to fail after duplication is resolved.
-#warn
-WITH non_unique AS (
-  SELECT
-    COUNT(*) AS total_count
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  GROUP BY
-    client_id
-  HAVING
-    total_count > 1
-)
-SELECT
-  IF(
-    (SELECT COUNT(*) FROM non_unique) > 0,
-    ERROR(
-      "Duplicates detected (Expected combined set of values for columns ['client_id'] to be unique.)"
-    ),
-    NULL
-  );
-
-#fail
-WITH null_checks AS (
-  SELECT
-    [
-      IF(COUNTIF(client_id IS NULL) > 0, "client_id", NULL),
-      IF(COUNTIF(sample_id IS NULL) > 0, "sample_id", NULL)
-    ] AS checks
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-),
-non_null_checks AS (
-  SELECT
-    ARRAY_AGG(u IGNORE NULLS) AS checks
-  FROM
-    null_checks,
-    UNNEST(checks) AS u
-)
-SELECT
-  IF(
-    (SELECT ARRAY_LENGTH(checks) FROM non_null_checks) > 0,
-    ERROR(
-      CONCAT(
-        "Columns with NULL values: ",
-        (SELECT ARRAY_TO_STRING(checks, ", ") FROM non_null_checks)
-      )
-    ),
-    NULL
-  );
-
-#fail
-WITH min_row_count AS (
-  SELECT
-    COUNT(*) AS total_rows
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-)
-SELECT
-  IF(
-    (SELECT COUNTIF(total_rows < 1) FROM min_row_count) > 0,
-    ERROR(
-      CONCAT(
-        "Min Row Count Error: ",
-        (SELECT total_rows FROM min_row_count),
-        " rows found, expected more than 1 rows"
-      )
-    ),
-    NULL
-  );
-
-#warn
-WITH base AS (
-  SELECT
-    COUNTIF(is_activated)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-),
-upstream AS (
-  SELECT
-    COUNTIF(activated = 1)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.new_profile_activation_v1`
-  WHERE
-    first_seen_date = @submission_date
-    AND submission_date = DATE_SUB(@submission_date, INTERVAL 6 DAY)
-)
-SELECT
-  IF(
-    (SELECT * FROM base) <> (SELECT * FROM upstream),
-    ERROR(
-      CONCAT(
-        "Number of activations does not match up that of the upstream table. Upstream count: ",
-        (SELECT * FROM upstream),
-        ", base count: ",
-        (SELECT * FROM base)
-      )
-    ),
-    NULL
-  );
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,57 +0,0 @@
-friendly_name: Firefox Android Clients
-description: |-
-  First observations for Firefox Android clients of channel Release,
-  retrieved from the earliest pings: baseline, first_session and metrics.
-  The attributes stored in this table include the first attribution,
-  device, OS and ISP details.
-
-  This table should be accessed through the user-facing view
-  `fenix.firefox_android_clients`.
-
-  For analysis purposes, use first_seen_date to query clients that
-  effectively appeared on that date. The submission_date indicates
-  when the server received the data.
-
-  The query for this table overwrites the whole table instead of writing to
-  a single partition, so manual backfills must use parameter --no_partition.
-
-  Proposal:
-  https://docs.google.com/document/d/12bj4DhCybelqHVgOVq8KJlzgtbbUw3f68palNrv-gaM/.
-
-  For more details about attribution and campaign structure see:
-  https://help.adjust.com/en/article/tracker-urls#campaign-structure-parameters.
-owners:
-- kik@mozilla.com
-labels:
-  application: firefox_android
-  incremental: true
-  schedule: daily
-  owner1: kik
-  dag: bqetl_analytics_tables
-scheduling:
-  dag_name: bqetl_analytics_tables
-  depends_on_past: true
-  date_partition_parameter: null
-  parameters:
-  - submission_date:DATE:{{ds}}
-  depends_on:
-  - task_id: baseline_clients_daily
-    dag_name: copy_deduplicate
-    execution_delta: 1h
-bigquery:
-  time_partitioning:
-    type: day
-    field: first_seen_date
-    require_partition_filter: false
-    expiration_days: null
-  clustering:
-    fields:
-    - sample_id
-    - channel
-    - first_reported_country
-workgroup_access:
-- role: roles/bigquery.dataViewer
-  members:
-  - workgroup:mozilla-confidential
-references: {}
-deprecated: false
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,237 +0,0 @@
--- Query first observations for Firefox Android Clients.
-WITH baseline_first_seen AS (
-  SELECT
-    client_id,
-    submission_date,
-    first_seen_date,
-    sample_id,
-    country AS first_reported_country,
-    isp AS first_reported_isp,
-    normalized_channel AS channel,
-    device_manufacturer,
-    device_model,
-    normalized_os_version AS os_version,
-    app_display_version AS app_version,
-    DATETIME(first_run_date) AS first_run_datetime,
-    locale,
-  FROM
-    fenix.baseline_clients_first_seen
-  WHERE
-    submission_date = @submission_date
-    AND client_id IS NOT NULL
-),
-activations AS (
-  SELECT
-    client_id,
-    CAST(activated AS BOOLEAN) AS is_activated,
-  FROM
-    fenix.new_profile_activation
-  WHERE
-    submission_date = @submission_date
-),
--- Find earliest data per client from the first_session ping.
-first_session_ping_base AS (
-  SELECT
-    client_info.client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(metrics.string.first_session_adgroup, "") AS adjust_ad_group,
-    NULLIF(metrics.string.first_session_campaign, "") AS adjust_campaign,
-    NULLIF(metrics.string.first_session_creative, "") AS adjust_creative,
-    NULLIF(metrics.string.first_session_network, "") AS adjust_network,
-  FROM
-    fenix.first_session
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-first_session_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-  FROM
-    first_session_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
--- Find earliest data per client from the metrics ping.
-metrics_ping_base AS (
-  SELECT
-    client_info.client_id AS client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_ad_group, "") AS adjust_ad_group,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_campaign, "") AS adjust_campaign,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_creative, "") AS adjust_creative,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_network, "") AS adjust_network,
-    NULLIF(fenix_metrics.metrics.string.metrics_install_source, "") AS install_source,
-  FROM
-    fenix.metrics AS fenix_metrics
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-metrics_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-    ARRAY_AGG(install_source IGNORE NULLS ORDER BY submission_timestamp ASC)[
-      SAFE_OFFSET(0)
-    ] AS install_source,
-  FROM
-    metrics_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
-_current AS (
-  SELECT
-    client_id,
-    sample_id,
-    first_seen_date,
-    first_reported_country,
-    first_reported_isp,
-    channel,
-    device_manufacturer,
-    device_model,
-    os_version,
-    app_version,
-    locale,
-    COALESCE(first_session.adjust_info, metrics.adjust_info) AS adjust_info,
-    metrics.install_source,
-    STRUCT(
-      IF(baseline_first_seen.client_id IS NULL, FALSE, TRUE) AS reported_baseline_ping,
-      IF(first_session.client_id IS NULL, FALSE, TRUE) AS reported_first_session_ping,
-      IF(metrics.client_id IS NULL, FALSE, TRUE) AS reported_metrics_ping,
-      CASE
-        WHEN first_session.adjust_info IS NOT NULL
-          THEN "first_session"
-        WHEN metrics.adjust_info IS NOT NULL
-          THEN "metrics"
-        ELSE NULL
-      END AS adjust_info__source_ping
-    ) AS metadata,
-  FROM
-    baseline_first_seen
-  FULL OUTER JOIN
-    first_session_ping AS first_session
-  USING
-    (client_id, sample_id)
-  FULL OUTER JOIN
-    metrics_ping AS metrics
-  USING
-    (client_id, sample_id)
-  WHERE
-    client_id IS NOT NULL
-),
-_previous AS (
-  SELECT
-    *
-  FROM
-    fenix_derived.firefox_android_clients_v2
-)
-SELECT
-  client_id,
-  sample_id,
-  COALESCE(_previous.first_seen_date, _current.first_seen_date) AS first_seen_date,
-  COALESCE(
-    _previous.first_reported_country,
-    _current.first_reported_country
-  ) AS first_reported_country,
-  COALESCE(_previous.first_reported_isp, _current.first_reported_isp) AS first_reported_isp,
-  COALESCE(_previous.channel, _current.channel) AS channel,
-  COALESCE(_previous.device_manufacturer, _current.device_manufacturer) AS device_manufacturer,
-  COALESCE(_previous.device_model, _current.device_model) AS device_model,
-  COALESCE(_previous.os_version, _current.os_version) AS os_version,
-  COALESCE(_previous.app_version, _current.app_version) AS app_version,
-  COALESCE(_previous.locale, _current.locale) AS locale,
-  activations.is_activated,
-  -- below is to avoid mix and matching different adjust attributes
-  -- from different records. This way we always treat them as a single "unit"
-  IF(
-    _previous.adjust_ad_group IS NULL
-    AND _previous.adjust_campaign IS NULL
-    AND _previous.adjust_creative IS NULL
-    AND _previous.adjust_network IS NULL,
-    _current.adjust_info,
-    STRUCT(
-      _previous.submission_timestamp,
-      _previous.adjust_ad_group,
-      _previous.adjust_campaign,
-      _previous.adjust_creative,
-      _previous.adjust_network
-    )
-  ).*,
-  COALESCE(_previous.install_source, _current.install_source) AS install_source,
-  STRUCT(
-    COALESCE(
-      _previous.metadata.reported_baseline_ping
-      OR _current.metadata.reported_baseline_ping,
-      FALSE
-    ) AS reported_baseline_ping,
-    COALESCE(
-      _previous.metadata.reported_first_session_ping
-      OR _current.metadata.reported_first_session_ping,
-      FALSE
-    ) AS reported_first_session_ping,
-    COALESCE(
-      _previous.metadata.reported_metrics_ping
-      OR _current.metadata.reported_metrics_ping,
-      FALSE
-    ) AS reported_metrics_ping,
-    COALESCE(
-      _previous.metadata.adjust_info__source_ping,
-      _current.metadata.adjust_info__source_ping
-    ) AS adjust_info__source_ping
-  ) AS metadata,
-FROM
-  _current
-FULL OUTER JOIN
-  _previous
-USING
-  (client_id, sample_id)
-LEFT JOIN
-  activations
-USING
-  (client_id)
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,140 +0,0 @@
-fields:
-
-- mode: NULLABLE
-  name: client_id
-  type: STRING
-  description: |
-    Unique ID for the client installation.
-
-- mode: NULLABLE
-  name: sample_id
-  type: INTEGER
-  description: |
-    Sample ID to limit query results during an analysis.
-
-- mode: NULLABLE
-  name: first_seen_date
-  type: DATE
-  description: |
-    Date when the app first reported a baseline ping for the client.
-
-- mode: NULLABLE
-  name: first_reported_country
-  type: STRING
-  description: |
-    First reported country for the client installation.
-
-- mode: NULLABLE
-  name: first_reported_isp
-  type: STRING
-  description: |
-    Name of the first reported isp (Internet Service Provider).
-
-- mode: NULLABLE
-  name: channel
-  type: STRING
-  description: |
-    Channel where the browser is released.
-
-- mode: NULLABLE
-  name: device_manufacturer
-  type: STRING
-  description: |
-    Manufacturer of the device where the client is installed.
-
-- mode: NULLABLE
-  name: device_model
-  type: STRING
-  description: |
-    Model of the device where the client is installed.
-
-- mode: NULLABLE
-  name: os_version
-  type: STRING
-  description: |
-    Version of the Operating System where the client is originally installed.
-
-- mode: NULLABLE
-  name: app_version
-  type: STRING
-  description: |
-    App display version for this client installation.
-
-- mode: NULLABLE
-  name: locale
-  type: STRING
-  description: |
-    Client's initial locale.
-
-- mode: NULLABLE
-  name: is_activated
-  type: BOOLEAN
-  description: |
-    Determines if a client is activated based on the activation metric and a 7 day lag.
-
-- mode: NULLABLE
-  name: submission_timestamp
-  type: TIMESTAMP
-  description: |
-    Timestamp of the ping which contained the adjust information.
-
-- mode: NULLABLE
-  name: adjust_ad_group
-  type: STRING
-  description: |
-    Structure parameter for the the ad group of a campaign.
-
-- mode: NULLABLE
-  name: adjust_campaign
-  type: STRING
-  description: |
-    Structure parameter for the campaign name.
-
-- mode: NULLABLE
-  name: adjust_creative
-  type: STRING
-  description: |
-    Structure parameter for the creative content of a campaign.
-
-- mode: NULLABLE
-  name: adjust_network
-  type: STRING
-  description: |
-    The type of source of a client installation.
-
-- mode: NULLABLE
-  name: install_source
-  type: STRING
-  description: |
-    This value is only sourced from the metrics ping.
-
-- mode: NULLABLE
-  name: metadata
-  type: RECORD
-  description: |
-    Additional context around the source of this record.
-
-  fields:
-  - mode: NULLABLE
-    name: reported_baseline_ping
-    type: BOOLEAN
-    description: |
-      True if the client reported a baseline_clients_first_seen ping.
-
-  - mode: NULLABLE
-    name: reported_first_session_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a first_session ping.
-
-  - mode: NULLABLE
-    name: reported_metrics_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a metrics ping.
-
-  - mode: NULLABLE
-    name: adjust_info__source_ping
-    type: STRING
-    description: |
-      Ping from which the adjust_info values originate.
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/metadata.yaml	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/metadata.yaml	2023-11-29 16:05:56.000000000 +0000
@@ -2,7 +2,7 @@
 description: |-
   This a view that UNIONs the stable ping tables
   across all channels of the Glean application "Firefox for iOS"
-  (org_mozilla_ios_firefox.temp_baseline, org_mozilla_ios_fennec.temp_baseline).
+  (org_mozilla_ios_firefox.temp_baseline, org_mozilla_ios_firefoxbeta.temp_baseline, org_mozilla_ios_fennec.temp_baseline).
 
   It is used by Looker.
 owners: []
@@ -16,4 +16,5 @@
   view.sql:
   - moz-fx-data-shared-prod.org_mozilla_ios_fennec.temp_baseline
   - moz-fx-data-shared-prod.org_mozilla_ios_firefox.temp_baseline
+  - moz-fx-data-shared-prod.org_mozilla_ios_firefoxbeta.temp_baseline
 deprecated: false
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/view.sql	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios/temp_baseline/view.sql	2023-11-29 16:03:29.000000000 +0000
@@ -22,6 +22,25 @@
   `moz-fx-data-shared-prod.org_mozilla_ios_firefox.temp_baseline`
 UNION ALL
 SELECT
+  "org_mozilla_ios_firefoxbeta" AS normalized_app_id,
+  "beta" AS normalized_channel,
+  additional_properties,
+  client_info,
+  document_id,
+  events,
+  metadata,
+  metrics,
+  normalized_app_name,
+  normalized_country_code,
+  normalized_os,
+  normalized_os_version,
+  ping_info,
+  sample_id,
+  submission_timestamp
+FROM
+  `moz-fx-data-shared-prod.org_mozilla_ios_firefoxbeta.temp_baseline`
+UNION ALL
+SELECT
   "org_mozilla_ios_fennec" AS normalized_app_id,
   "nightly" AS normalized_channel,
   additional_properties,
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml	2023-11-29 16:07:47.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml	2023-11-29 15:58:54.000000000 +0000
@@ -2,21 +2,18 @@
 - name: date
   type: DATE
   mode: NULLABLE
-  description: null
 - name: product
   type: STRING
   mode: NULLABLE
 - name: category
   type: STRING
   mode: NULLABLE
-  description: null
 - name: channel
   type: STRING
   mode: NULLABLE
 - name: build_number
   type: INTEGER
   mode: NULLABLE
-  description: null
 - name: release_date
   type: DATE
   mode: NULLABLE

Link to full diff

@kik-kik kik-kik force-pushed the feat/removing-fenix_derived-firefox-android-clients-v2 branch from 0008e13 to 06185b3 Compare November 30, 2023 14:38
@dataops-ci-bot
Copy link

Integration report for "removed fenix_derived.firefox_android_clients_v2 from shredder config"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py	2023-11-30 15:00:19.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py	2023-11-30 14:59:49.000000000 +0000
@@ -79,25 +79,6 @@
             checks__fail_fenix_derived__firefox_android_clients__v1
         )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__fail_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=True,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1 = bigquery_dq_check(
         task_id="checks__warn_fenix_derived__firefox_android_clients__v1",
         source_table="firefox_android_clients_v1",
@@ -116,25 +97,6 @@
         retries=0,
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__warn_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=False,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     clients_first_seen_v2 = bigquery_etl_query(
         task_id="clients_first_seen_v2",
         destination_table="clients_first_seen_v2",
@@ -174,23 +136,6 @@
 
         clients_first_seen_v2_external.set_upstream(clients_first_seen_v2)
 
-    fenix_derived__firefox_android_clients__v2 = bigquery_etl_query(
-        task_id="fenix_derived__firefox_android_clients__v2",
-        destination_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        date_partition_parameter=None,
-        depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1 = bigquery_etl_query(
         task_id="fenix_derived__funnel_retention_clients_week_2__v1",
         destination_table="funnel_retention_clients_week_2_v1",
@@ -293,14 +238,6 @@
         firefox_android_clients
     )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1.set_upstream(
         wait_for_baseline_clients_daily
     )
@@ -309,14 +246,6 @@
         firefox_android_clients
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -356,28 +285,6 @@
 
     clients_first_seen_v2.set_upstream(wait_for_telemetry_derived__clients_daily__v6)
 
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_baseline_clients_daily
-    )
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_copy_deduplicate_all
-    )
-    wait_for_fenix_derived__new_profile_activation__v1 = ExternalTaskSensor(
-        task_id="wait_for_fenix_derived__new_profile_activation__v1",
-        external_dag_id="bqetl_mobile_activation",
-        external_task_id="fenix_derived__new_profile_activation__v1",
-        execution_delta=datetime.timedelta(seconds=7200),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_fenix_derived__new_profile_activation__v1
-    )
-
     wait_for_baseline_clients_last_seen = ExternalTaskSensor(
         task_id="wait_for_baseline_clients_last_seen",
         external_dag_id="copy_deduplicate",
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py	2023-11-30 15:00:18.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py	2023-11-30 14:59:49.000000000 +0000
@@ -54,20 +54,6 @@
         depends_on_past=False,
     )
 
-    with TaskGroup(
-        "fenix_derived__new_profile_activation__v1_external"
-    ) as fenix_derived__new_profile_activation__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_fenix_derived__new_profile_activation__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_fenix_derived__new_profile_activation__v1",
-            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=79200)).isoformat() }}",
-        )
-
-        fenix_derived__new_profile_activation__v1_external.set_upstream(
-            fenix_derived__new_profile_activation__v1
-        )
-
     firefox_ios_derived__new_profile_activation__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__new_profile_activation__v1",
         destination_table="new_profile_activation_v1",
Only in /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived: firefox_android_clients_v2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	2023-11-30 14:59:26.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,104 +0,0 @@
-
--- TODO: convert is_unique to fail after duplication is resolved.
-#warn
-WITH non_unique AS (
-  SELECT
-    COUNT(*) AS total_count
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  GROUP BY
-    client_id
-  HAVING
-    total_count > 1
-)
-SELECT
-  IF(
-    (SELECT COUNT(*) FROM non_unique) > 0,
-    ERROR(
-      "Duplicates detected (Expected combined set of values for columns ['client_id'] to be unique.)"
-    ),
-    NULL
-  );
-
-#fail
-WITH null_checks AS (
-  SELECT
-    [
-      IF(COUNTIF(client_id IS NULL) > 0, "client_id", NULL),
-      IF(COUNTIF(sample_id IS NULL) > 0, "sample_id", NULL)
-    ] AS checks
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-),
-non_null_checks AS (
-  SELECT
-    ARRAY_AGG(u IGNORE NULLS) AS checks
-  FROM
-    null_checks,
-    UNNEST(checks) AS u
-)
-SELECT
-  IF(
-    (SELECT ARRAY_LENGTH(checks) FROM non_null_checks) > 0,
-    ERROR(
-      CONCAT(
-        "Columns with NULL values: ",
-        (SELECT ARRAY_TO_STRING(checks, ", ") FROM non_null_checks)
-      )
-    ),
-    NULL
-  );
-
-#fail
-WITH min_row_count AS (
-  SELECT
-    COUNT(*) AS total_rows
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-)
-SELECT
-  IF(
-    (SELECT COUNTIF(total_rows < 1) FROM min_row_count) > 0,
-    ERROR(
-      CONCAT(
-        "Min Row Count Error: ",
-        (SELECT total_rows FROM min_row_count),
-        " rows found, expected more than 1 rows"
-      )
-    ),
-    NULL
-  );
-
-#warn
-WITH base AS (
-  SELECT
-    COUNTIF(is_activated)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-),
-upstream AS (
-  SELECT
-    COUNTIF(activated = 1)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.new_profile_activation_v1`
-  WHERE
-    first_seen_date = @submission_date
-    AND submission_date = DATE_SUB(@submission_date, INTERVAL 6 DAY)
-)
-SELECT
-  IF(
-    (SELECT * FROM base) <> (SELECT * FROM upstream),
-    ERROR(
-      CONCAT(
-        "Number of activations does not match up that of the upstream table. Upstream count: ",
-        (SELECT * FROM upstream),
-        ", base count: ",
-        (SELECT * FROM base)
-      )
-    ),
-    NULL
-  );
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	2023-11-30 14:59:26.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,57 +0,0 @@
-friendly_name: Firefox Android Clients
-description: |-
-  First observations for Firefox Android clients of channel Release,
-  retrieved from the earliest pings: baseline, first_session and metrics.
-  The attributes stored in this table include the first attribution,
-  device, OS and ISP details.
-
-  This table should be accessed through the user-facing view
-  `fenix.firefox_android_clients`.
-
-  For analysis purposes, use first_seen_date to query clients that
-  effectively appeared on that date. The submission_date indicates
-  when the server received the data.
-
-  The query for this table overwrites the whole table instead of writing to
-  a single partition, so manual backfills must use parameter --no_partition.
-
-  Proposal:
-  https://docs.google.com/document/d/12bj4DhCybelqHVgOVq8KJlzgtbbUw3f68palNrv-gaM/.
-
-  For more details about attribution and campaign structure see:
-  https://help.adjust.com/en/article/tracker-urls#campaign-structure-parameters.
-owners:
-- kik@mozilla.com
-labels:
-  application: firefox_android
-  incremental: true
-  schedule: daily
-  owner1: kik
-  dag: bqetl_analytics_tables
-scheduling:
-  dag_name: bqetl_analytics_tables
-  depends_on_past: true
-  date_partition_parameter: null
-  parameters:
-  - submission_date:DATE:{{ds}}
-  depends_on:
-  - task_id: baseline_clients_daily
-    dag_name: copy_deduplicate
-    execution_delta: 1h
-bigquery:
-  time_partitioning:
-    type: day
-    field: first_seen_date
-    require_partition_filter: false
-    expiration_days: null
-  clustering:
-    fields:
-    - sample_id
-    - channel
-    - first_reported_country
-workgroup_access:
-- role: roles/bigquery.dataViewer
-  members:
-  - workgroup:mozilla-confidential
-references: {}
-deprecated: false
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	2023-11-30 14:59:26.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,237 +0,0 @@
--- Query first observations for Firefox Android Clients.
-WITH baseline_first_seen AS (
-  SELECT
-    client_id,
-    submission_date,
-    first_seen_date,
-    sample_id,
-    country AS first_reported_country,
-    isp AS first_reported_isp,
-    normalized_channel AS channel,
-    device_manufacturer,
-    device_model,
-    normalized_os_version AS os_version,
-    app_display_version AS app_version,
-    DATETIME(first_run_date) AS first_run_datetime,
-    locale,
-  FROM
-    fenix.baseline_clients_first_seen
-  WHERE
-    submission_date = @submission_date
-    AND client_id IS NOT NULL
-),
-activations AS (
-  SELECT
-    client_id,
-    CAST(activated AS BOOLEAN) AS is_activated,
-  FROM
-    fenix.new_profile_activation
-  WHERE
-    submission_date = @submission_date
-),
--- Find earliest data per client from the first_session ping.
-first_session_ping_base AS (
-  SELECT
-    client_info.client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(metrics.string.first_session_adgroup, "") AS adjust_ad_group,
-    NULLIF(metrics.string.first_session_campaign, "") AS adjust_campaign,
-    NULLIF(metrics.string.first_session_creative, "") AS adjust_creative,
-    NULLIF(metrics.string.first_session_network, "") AS adjust_network,
-  FROM
-    fenix.first_session
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-first_session_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-  FROM
-    first_session_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
--- Find earliest data per client from the metrics ping.
-metrics_ping_base AS (
-  SELECT
-    client_info.client_id AS client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_ad_group, "") AS adjust_ad_group,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_campaign, "") AS adjust_campaign,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_creative, "") AS adjust_creative,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_network, "") AS adjust_network,
-    NULLIF(fenix_metrics.metrics.string.metrics_install_source, "") AS install_source,
-  FROM
-    fenix.metrics AS fenix_metrics
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-metrics_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-    ARRAY_AGG(install_source IGNORE NULLS ORDER BY submission_timestamp ASC)[
-      SAFE_OFFSET(0)
-    ] AS install_source,
-  FROM
-    metrics_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
-_current AS (
-  SELECT
-    client_id,
-    sample_id,
-    first_seen_date,
-    first_reported_country,
-    first_reported_isp,
-    channel,
-    device_manufacturer,
-    device_model,
-    os_version,
-    app_version,
-    locale,
-    COALESCE(first_session.adjust_info, metrics.adjust_info) AS adjust_info,
-    metrics.install_source,
-    STRUCT(
-      IF(baseline_first_seen.client_id IS NULL, FALSE, TRUE) AS reported_baseline_ping,
-      IF(first_session.client_id IS NULL, FALSE, TRUE) AS reported_first_session_ping,
-      IF(metrics.client_id IS NULL, FALSE, TRUE) AS reported_metrics_ping,
-      CASE
-        WHEN first_session.adjust_info IS NOT NULL
-          THEN "first_session"
-        WHEN metrics.adjust_info IS NOT NULL
-          THEN "metrics"
-        ELSE NULL
-      END AS adjust_info__source_ping
-    ) AS metadata,
-  FROM
-    baseline_first_seen
-  FULL OUTER JOIN
-    first_session_ping AS first_session
-  USING
-    (client_id, sample_id)
-  FULL OUTER JOIN
-    metrics_ping AS metrics
-  USING
-    (client_id, sample_id)
-  WHERE
-    client_id IS NOT NULL
-),
-_previous AS (
-  SELECT
-    *
-  FROM
-    fenix_derived.firefox_android_clients_v2
-)
-SELECT
-  client_id,
-  sample_id,
-  COALESCE(_previous.first_seen_date, _current.first_seen_date) AS first_seen_date,
-  COALESCE(
-    _previous.first_reported_country,
-    _current.first_reported_country
-  ) AS first_reported_country,
-  COALESCE(_previous.first_reported_isp, _current.first_reported_isp) AS first_reported_isp,
-  COALESCE(_previous.channel, _current.channel) AS channel,
-  COALESCE(_previous.device_manufacturer, _current.device_manufacturer) AS device_manufacturer,
-  COALESCE(_previous.device_model, _current.device_model) AS device_model,
-  COALESCE(_previous.os_version, _current.os_version) AS os_version,
-  COALESCE(_previous.app_version, _current.app_version) AS app_version,
-  COALESCE(_previous.locale, _current.locale) AS locale,
-  activations.is_activated,
-  -- below is to avoid mix and matching different adjust attributes
-  -- from different records. This way we always treat them as a single "unit"
-  IF(
-    _previous.adjust_ad_group IS NULL
-    AND _previous.adjust_campaign IS NULL
-    AND _previous.adjust_creative IS NULL
-    AND _previous.adjust_network IS NULL,
-    _current.adjust_info,
-    STRUCT(
-      _previous.submission_timestamp,
-      _previous.adjust_ad_group,
-      _previous.adjust_campaign,
-      _previous.adjust_creative,
-      _previous.adjust_network
-    )
-  ).*,
-  COALESCE(_previous.install_source, _current.install_source) AS install_source,
-  STRUCT(
-    COALESCE(
-      _previous.metadata.reported_baseline_ping
-      OR _current.metadata.reported_baseline_ping,
-      FALSE
-    ) AS reported_baseline_ping,
-    COALESCE(
-      _previous.metadata.reported_first_session_ping
-      OR _current.metadata.reported_first_session_ping,
-      FALSE
-    ) AS reported_first_session_ping,
-    COALESCE(
-      _previous.metadata.reported_metrics_ping
-      OR _current.metadata.reported_metrics_ping,
-      FALSE
-    ) AS reported_metrics_ping,
-    COALESCE(
-      _previous.metadata.adjust_info__source_ping,
-      _current.metadata.adjust_info__source_ping
-    ) AS adjust_info__source_ping
-  ) AS metadata,
-FROM
-  _current
-FULL OUTER JOIN
-  _previous
-USING
-  (client_id, sample_id)
-LEFT JOIN
-  activations
-USING
-  (client_id)
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	2023-11-30 14:59:26.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,140 +0,0 @@
-fields:
-
-- mode: NULLABLE
-  name: client_id
-  type: STRING
-  description: |
-    Unique ID for the client installation.
-
-- mode: NULLABLE
-  name: sample_id
-  type: INTEGER
-  description: |
-    Sample ID to limit query results during an analysis.
-
-- mode: NULLABLE
-  name: first_seen_date
-  type: DATE
-  description: |
-    Date when the app first reported a baseline ping for the client.
-
-- mode: NULLABLE
-  name: first_reported_country
-  type: STRING
-  description: |
-    First reported country for the client installation.
-
-- mode: NULLABLE
-  name: first_reported_isp
-  type: STRING
-  description: |
-    Name of the first reported isp (Internet Service Provider).
-
-- mode: NULLABLE
-  name: channel
-  type: STRING
-  description: |
-    Channel where the browser is released.
-
-- mode: NULLABLE
-  name: device_manufacturer
-  type: STRING
-  description: |
-    Manufacturer of the device where the client is installed.
-
-- mode: NULLABLE
-  name: device_model
-  type: STRING
-  description: |
-    Model of the device where the client is installed.
-
-- mode: NULLABLE
-  name: os_version
-  type: STRING
-  description: |
-    Version of the Operating System where the client is originally installed.
-
-- mode: NULLABLE
-  name: app_version
-  type: STRING
-  description: |
-    App display version for this client installation.
-
-- mode: NULLABLE
-  name: locale
-  type: STRING
-  description: |
-    Client's initial locale.
-
-- mode: NULLABLE
-  name: is_activated
-  type: BOOLEAN
-  description: |
-    Determines if a client is activated based on the activation metric and a 7 day lag.
-
-- mode: NULLABLE
-  name: submission_timestamp
-  type: TIMESTAMP
-  description: |
-    Timestamp of the ping which contained the adjust information.
-
-- mode: NULLABLE
-  name: adjust_ad_group
-  type: STRING
-  description: |
-    Structure parameter for the the ad group of a campaign.
-
-- mode: NULLABLE
-  name: adjust_campaign
-  type: STRING
-  description: |
-    Structure parameter for the campaign name.
-
-- mode: NULLABLE
-  name: adjust_creative
-  type: STRING
-  description: |
-    Structure parameter for the creative content of a campaign.
-
-- mode: NULLABLE
-  name: adjust_network
-  type: STRING
-  description: |
-    The type of source of a client installation.
-
-- mode: NULLABLE
-  name: install_source
-  type: STRING
-  description: |
-    This value is only sourced from the metrics ping.
-
-- mode: NULLABLE
-  name: metadata
-  type: RECORD
-  description: |
-    Additional context around the source of this record.
-
-  fields:
-  - mode: NULLABLE
-    name: reported_baseline_ping
-    type: BOOLEAN
-    description: |
-      True if the client reported a baseline_clients_first_seen ping.
-
-  - mode: NULLABLE
-    name: reported_first_session_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a first_session ping.
-
-  - mode: NULLABLE
-    name: reported_metrics_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a metrics ping.
-
-  - mode: NULLABLE
-    name: adjust_info__source_ping
-    type: STRING
-    description: |
-      Ping from which the adjust_info values originate.

Link to full diff

@kik-kik kik-kik force-pushed the feat/removing-fenix_derived-firefox-android-clients-v2 branch from 06185b3 to 1d350ca Compare December 1, 2023 09:12
@dataops-ci-bot
Copy link

Integration report for "removed fenix_derived.firefox_android_clients_v2 from shredder config"

sql.diff

Click to expand!
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_analytics_tables.py	2023-12-01 09:35:53.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_analytics_tables.py	2023-12-01 09:35:37.000000000 +0000
@@ -79,25 +79,6 @@
             checks__fail_fenix_derived__firefox_android_clients__v1
         )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__fail_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=True,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1 = bigquery_dq_check(
         task_id="checks__warn_fenix_derived__firefox_android_clients__v1",
         source_table="firefox_android_clients_v1",
@@ -116,25 +97,6 @@
         retries=0,
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2 = bigquery_dq_check(
-        task_id="checks__warn_fenix_derived__firefox_android_clients__v2",
-        source_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        is_dq_check_fail=False,
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        depends_on_past=False,
-        task_concurrency=1,
-        parameters=["submission_date:DATE:{{ds}}"],
-        retries=0,
-    )
-
     clients_first_seen_v2 = bigquery_etl_query(
         task_id="clients_first_seen_v2",
         destination_table="clients_first_seen_v2",
@@ -176,23 +138,6 @@
 
         clients_first_seen_v2_external.set_upstream(clients_first_seen_v2)
 
-    fenix_derived__firefox_android_clients__v2 = bigquery_etl_query(
-        task_id="fenix_derived__firefox_android_clients__v2",
-        destination_table="firefox_android_clients_v2",
-        dataset_id="fenix_derived",
-        project_id="moz-fx-data-shared-prod",
-        owner="kik@mozilla.com",
-        email=[
-            "gkaberere@mozilla.com",
-            "kik@mozilla.com",
-            "lvargas@mozilla.com",
-            "telemetry-alerts@mozilla.com",
-        ],
-        date_partition_parameter=None,
-        depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1 = bigquery_etl_query(
         task_id="fenix_derived__funnel_retention_clients_week_2__v1",
         destination_table="funnel_retention_clients_week_2_v1",
@@ -279,18 +224,10 @@
         firefox_android_clients
     )
 
-    checks__fail_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     checks__warn_fenix_derived__firefox_android_clients__v1.set_upstream(
         firefox_android_clients
     )
 
-    checks__warn_fenix_derived__firefox_android_clients__v2.set_upstream(
-        fenix_derived__firefox_android_clients__v2
-    )
-
     wait_for_copy_deduplicate_all = ExternalTaskSensor(
         task_id="wait_for_copy_deduplicate_all",
         external_dag_id="copy_deduplicate",
@@ -330,95 +267,6 @@
 
     clients_first_seen_v2.set_upstream(wait_for_telemetry_derived__clients_daily__v6)
 
-    wait_for_checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1 = ExternalTaskSensor(
-        task_id="wait_for_checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1",
-        external_dag_id="bqetl_glean_usage",
-        external_task_id="checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1",
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1
-    )
-    wait_for_checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1 = ExternalTaskSensor(
-        task_id="wait_for_checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1",
-        external_dag_id="bqetl_glean_usage",
-        external_task_id="checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1",
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1
-    )
-    wait_for_checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1 = ExternalTaskSensor(
-        task_id="wait_for_checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1",
-        external_dag_id="bqetl_glean_usage",
-        external_task_id="checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1",
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1
-    )
-    wait_for_checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1 = ExternalTaskSensor(
-        task_id="wait_for_checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1",
-        external_dag_id="bqetl_glean_usage",
-        external_task_id="checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1",
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1
-    )
-    wait_for_checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1 = ExternalTaskSensor(
-        task_id="wait_for_checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1",
-        external_dag_id="bqetl_glean_usage",
-        external_task_id="checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1",
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1
-    )
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_copy_deduplicate_all
-    )
-    wait_for_fenix_derived__new_profile_activation__v1 = ExternalTaskSensor(
-        task_id="wait_for_fenix_derived__new_profile_activation__v1",
-        external_dag_id="bqetl_mobile_activation",
-        external_task_id="fenix_derived__new_profile_activation__v1",
-        execution_delta=datetime.timedelta(seconds=7200),
-        check_existence=True,
-        mode="reschedule",
-        allowed_states=ALLOWED_STATES,
-        failed_states=FAILED_STATES,
-        pool="DATA_ENG_EXTERNALTASKSENSOR",
-    )
-
-    fenix_derived__firefox_android_clients__v2.set_upstream(
-        wait_for_fenix_derived__new_profile_activation__v1
-    )
-
     fenix_derived__funnel_retention_clients_week_2__v1.set_upstream(
         checks__fail_fenix_derived__firefox_android_clients__v1
     )
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_glean_usage.py /tmp/workspace/generated-sql/dags/bqetl_glean_usage.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_glean_usage.py	2023-12-01 09:35:56.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_glean_usage.py	2023-12-01 09:35:41.000000000 +0000
@@ -825,20 +825,6 @@
         task_group=task_group_fenix,
     )
 
-    with TaskGroup(
-        "checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1_external",
-        parent_group=task_group_fenix,
-    ) as checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1",
-        )
-
-        checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1_external.set_upstream(
-            checks__fail_org_mozilla_fenix_derived__baseline_clients_daily__v1
-        )
-
     checks__fail_org_mozilla_fenix_derived__baseline_clients_first_seen__v1 = bigquery_dq_check(
         task_id="checks__fail_org_mozilla_fenix_derived__baseline_clients_first_seen__v1",
         source_table="baseline_clients_first_seen_v1",
@@ -910,20 +896,6 @@
         task_group=task_group_fenix,
     )
 
-    with TaskGroup(
-        "checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1_external",
-        parent_group=task_group_fenix,
-    ) as checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1",
-        )
-
-        checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1_external.set_upstream(
-            checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1
-        )
-
     checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_first_seen__v1 = bigquery_dq_check(
         task_id="checks__fail_org_mozilla_fenix_nightly_derived__baseline_clients_first_seen__v1",
         source_table="baseline_clients_first_seen_v1",
@@ -995,20 +967,6 @@
         task_group=task_group_fenix,
     )
 
-    with TaskGroup(
-        "checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1_external",
-        parent_group=task_group_fenix,
-    ) as checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1",
-        )
-
-        checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1_external.set_upstream(
-            checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1
-        )
-
     checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_first_seen__v1 = bigquery_dq_check(
         task_id="checks__fail_org_mozilla_fennec_aurora_derived__baseline_clients_first_seen__v1",
         source_table="baseline_clients_first_seen_v1",
@@ -1080,20 +1038,6 @@
         task_group=task_group_fenix,
     )
 
-    with TaskGroup(
-        "checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1_external",
-        parent_group=task_group_fenix,
-    ) as checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1",
-        )
-
-        checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1_external.set_upstream(
-            checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_daily__v1
-        )
-
     checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_first_seen__v1 = bigquery_dq_check(
         task_id="checks__fail_org_mozilla_firefox_beta_derived__baseline_clients_first_seen__v1",
         source_table="baseline_clients_first_seen_v1",
@@ -1165,20 +1109,6 @@
         task_group=task_group_fenix,
     )
 
-    with TaskGroup(
-        "checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1_external",
-        parent_group=task_group_fenix,
-    ) as checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1",
-        )
-
-        checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1_external.set_upstream(
-            checks__fail_org_mozilla_firefox_derived__baseline_clients_daily__v1
-        )
-
     checks__fail_org_mozilla_firefox_derived__baseline_clients_first_seen__v1 = bigquery_dq_check(
         task_id="checks__fail_org_mozilla_firefox_derived__baseline_clients_first_seen__v1",
         source_table="baseline_clients_first_seen_v1",
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py
--- /tmp/workspace/main-generated-sql/dags/bqetl_mobile_activation.py	2023-12-01 09:35:53.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_mobile_activation.py	2023-12-01 09:35:37.000000000 +0000
@@ -54,20 +54,6 @@
         depends_on_past=False,
     )
 
-    with TaskGroup(
-        "fenix_derived__new_profile_activation__v1_external",
-    ) as fenix_derived__new_profile_activation__v1_external:
-        ExternalTaskMarker(
-            task_id="bqetl_analytics_tables__wait_for_fenix_derived__new_profile_activation__v1",
-            external_dag_id="bqetl_analytics_tables",
-            external_task_id="wait_for_fenix_derived__new_profile_activation__v1",
-            execution_date="{{ (execution_date - macros.timedelta(days=-1, seconds=79200)).isoformat() }}",
-        )
-
-        fenix_derived__new_profile_activation__v1_external.set_upstream(
-            fenix_derived__new_profile_activation__v1
-        )
-
     firefox_ios_derived__new_profile_activation__v1 = bigquery_etl_query(
         task_id="firefox_ios_derived__new_profile_activation__v1",
         destination_table="new_profile_activation_v1",
Only in /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived: firefox_android_clients_v2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	2023-12-01 09:34:54.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/checks.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,104 +0,0 @@
-
--- TODO: convert is_unique to fail after duplication is resolved.
-#warn
-WITH non_unique AS (
-  SELECT
-    COUNT(*) AS total_count
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  GROUP BY
-    client_id
-  HAVING
-    total_count > 1
-)
-SELECT
-  IF(
-    (SELECT COUNT(*) FROM non_unique) > 0,
-    ERROR(
-      "Duplicates detected (Expected combined set of values for columns ['client_id'] to be unique.)"
-    ),
-    NULL
-  );
-
-#fail
-WITH null_checks AS (
-  SELECT
-    [
-      IF(COUNTIF(client_id IS NULL) > 0, "client_id", NULL),
-      IF(COUNTIF(sample_id IS NULL) > 0, "sample_id", NULL)
-    ] AS checks
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-),
-non_null_checks AS (
-  SELECT
-    ARRAY_AGG(u IGNORE NULLS) AS checks
-  FROM
-    null_checks,
-    UNNEST(checks) AS u
-)
-SELECT
-  IF(
-    (SELECT ARRAY_LENGTH(checks) FROM non_null_checks) > 0,
-    ERROR(
-      CONCAT(
-        "Columns with NULL values: ",
-        (SELECT ARRAY_TO_STRING(checks, ", ") FROM non_null_checks)
-      )
-    ),
-    NULL
-  );
-
-#fail
-WITH min_row_count AS (
-  SELECT
-    COUNT(*) AS total_rows
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-)
-SELECT
-  IF(
-    (SELECT COUNTIF(total_rows < 1) FROM min_row_count) > 0,
-    ERROR(
-      CONCAT(
-        "Min Row Count Error: ",
-        (SELECT total_rows FROM min_row_count),
-        " rows found, expected more than 1 rows"
-      )
-    ),
-    NULL
-  );
-
-#warn
-WITH base AS (
-  SELECT
-    COUNTIF(is_activated)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.firefox_android_clients_v2`
-  WHERE
-    first_seen_date = @submission_date
-),
-upstream AS (
-  SELECT
-    COUNTIF(activated = 1)
-  FROM
-    `moz-fx-data-shared-prod.fenix_derived.new_profile_activation_v1`
-  WHERE
-    first_seen_date = @submission_date
-    AND submission_date = DATE_SUB(@submission_date, INTERVAL 6 DAY)
-)
-SELECT
-  IF(
-    (SELECT * FROM base) <> (SELECT * FROM upstream),
-    ERROR(
-      CONCAT(
-        "Number of activations does not match up that of the upstream table. Upstream count: ",
-        (SELECT * FROM upstream),
-        ", base count: ",
-        (SELECT * FROM base)
-      )
-    ),
-    NULL
-  );
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	2023-12-01 09:34:54.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,53 +0,0 @@
-friendly_name: Firefox Android Clients
-description: |-
-  First observations for Firefox Android clients of channel Release,
-  retrieved from the earliest pings: baseline, first_session and metrics.
-  The attributes stored in this table include the first attribution,
-  device, OS and ISP details.
-
-  This table should be accessed through the user-facing view
-  `fenix.firefox_android_clients`.
-
-  For analysis purposes, use first_seen_date to query clients that
-  effectively appeared on that date. The submission_date indicates
-  when the server received the data.
-
-  The query for this table overwrites the whole table instead of writing to
-  a single partition, so manual backfills must use parameter --no_partition.
-
-  Proposal:
-  https://docs.google.com/document/d/12bj4DhCybelqHVgOVq8KJlzgtbbUw3f68palNrv-gaM/.
-
-  For more details about attribution and campaign structure see:
-  https://help.adjust.com/en/article/tracker-urls#campaign-structure-parameters.
-owners:
-- kik@mozilla.com
-labels:
-  application: firefox_android
-  incremental: true
-  schedule: daily
-  owner1: kik
-  dag: bqetl_analytics_tables
-scheduling:
-  dag_name: bqetl_analytics_tables
-  depends_on_past: true
-  date_partition_parameter: null
-  parameters:
-  - submission_date:DATE:{{ds}}
-bigquery:
-  time_partitioning:
-    type: day
-    field: first_seen_date
-    require_partition_filter: false
-    expiration_days: null
-  clustering:
-    fields:
-    - sample_id
-    - channel
-    - first_reported_country
-workgroup_access:
-- role: roles/bigquery.dataViewer
-  members:
-  - workgroup:mozilla-confidential
-references: {}
-deprecated: false
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	2023-12-01 09:34:54.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql	1970-01-01 00:00:00.000000000 +0000
@@ -1,237 +0,0 @@
--- Query first observations for Firefox Android Clients.
-WITH baseline_first_seen AS (
-  SELECT
-    client_id,
-    submission_date,
-    first_seen_date,
-    sample_id,
-    country AS first_reported_country,
-    isp AS first_reported_isp,
-    normalized_channel AS channel,
-    device_manufacturer,
-    device_model,
-    normalized_os_version AS os_version,
-    app_display_version AS app_version,
-    DATETIME(first_run_date) AS first_run_datetime,
-    locale,
-  FROM
-    fenix.baseline_clients_first_seen
-  WHERE
-    submission_date = @submission_date
-    AND client_id IS NOT NULL
-),
-activations AS (
-  SELECT
-    client_id,
-    CAST(activated AS BOOLEAN) AS is_activated,
-  FROM
-    fenix.new_profile_activation
-  WHERE
-    submission_date = @submission_date
-),
--- Find earliest data per client from the first_session ping.
-first_session_ping_base AS (
-  SELECT
-    client_info.client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(metrics.string.first_session_adgroup, "") AS adjust_ad_group,
-    NULLIF(metrics.string.first_session_campaign, "") AS adjust_campaign,
-    NULLIF(metrics.string.first_session_creative, "") AS adjust_creative,
-    NULLIF(metrics.string.first_session_network, "") AS adjust_network,
-  FROM
-    fenix.first_session
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-first_session_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-  FROM
-    first_session_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
--- Find earliest data per client from the metrics ping.
-metrics_ping_base AS (
-  SELECT
-    client_info.client_id AS client_id,
-    sample_id,
-    submission_timestamp,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_ad_group, "") AS adjust_ad_group,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_campaign, "") AS adjust_campaign,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_creative, "") AS adjust_creative,
-    NULLIF(fenix_metrics.metrics.string.metrics_adjust_network, "") AS adjust_network,
-    NULLIF(fenix_metrics.metrics.string.metrics_install_source, "") AS install_source,
-  FROM
-    fenix.metrics AS fenix_metrics
-  WHERE
-    DATE(submission_timestamp) = @submission_date
-    AND client_info.client_id IS NOT NULL
-),
-metrics_ping AS (
-  SELECT
-    client_id,
-    sample_id,
-    ARRAY_AGG(
-      IF(
-        adjust_ad_group IS NOT NULL
-        OR adjust_campaign IS NOT NULL
-        OR adjust_creative IS NOT NULL
-        OR adjust_network IS NOT NULL,
-        STRUCT(
-          submission_timestamp,
-          adjust_ad_group,
-          adjust_campaign,
-          adjust_creative,
-          adjust_network
-        ),
-        NULL
-      ) IGNORE NULLS
-      ORDER BY
-        submission_timestamp ASC
-      LIMIT
-        1
-    )[SAFE_OFFSET(0)] AS adjust_info,
-    ARRAY_AGG(install_source IGNORE NULLS ORDER BY submission_timestamp ASC)[
-      SAFE_OFFSET(0)
-    ] AS install_source,
-  FROM
-    metrics_ping_base
-  GROUP BY
-    client_id,
-    sample_id
-),
-_current AS (
-  SELECT
-    client_id,
-    sample_id,
-    first_seen_date,
-    first_reported_country,
-    first_reported_isp,
-    channel,
-    device_manufacturer,
-    device_model,
-    os_version,
-    app_version,
-    locale,
-    COALESCE(first_session.adjust_info, metrics.adjust_info) AS adjust_info,
-    metrics.install_source,
-    STRUCT(
-      IF(baseline_first_seen.client_id IS NULL, FALSE, TRUE) AS reported_baseline_ping,
-      IF(first_session.client_id IS NULL, FALSE, TRUE) AS reported_first_session_ping,
-      IF(metrics.client_id IS NULL, FALSE, TRUE) AS reported_metrics_ping,
-      CASE
-        WHEN first_session.adjust_info IS NOT NULL
-          THEN "first_session"
-        WHEN metrics.adjust_info IS NOT NULL
-          THEN "metrics"
-        ELSE NULL
-      END AS adjust_info__source_ping
-    ) AS metadata,
-  FROM
-    baseline_first_seen
-  FULL OUTER JOIN
-    first_session_ping AS first_session
-  USING
-    (client_id, sample_id)
-  FULL OUTER JOIN
-    metrics_ping AS metrics
-  USING
-    (client_id, sample_id)
-  WHERE
-    client_id IS NOT NULL
-),
-_previous AS (
-  SELECT
-    *
-  FROM
-    fenix_derived.firefox_android_clients_v2
-)
-SELECT
-  client_id,
-  sample_id,
-  COALESCE(_previous.first_seen_date, _current.first_seen_date) AS first_seen_date,
-  COALESCE(
-    _previous.first_reported_country,
-    _current.first_reported_country
-  ) AS first_reported_country,
-  COALESCE(_previous.first_reported_isp, _current.first_reported_isp) AS first_reported_isp,
-  COALESCE(_previous.channel, _current.channel) AS channel,
-  COALESCE(_previous.device_manufacturer, _current.device_manufacturer) AS device_manufacturer,
-  COALESCE(_previous.device_model, _current.device_model) AS device_model,
-  COALESCE(_previous.os_version, _current.os_version) AS os_version,
-  COALESCE(_previous.app_version, _current.app_version) AS app_version,
-  COALESCE(_previous.locale, _current.locale) AS locale,
-  activations.is_activated,
-  -- below is to avoid mix and matching different adjust attributes
-  -- from different records. This way we always treat them as a single "unit"
-  IF(
-    _previous.adjust_ad_group IS NULL
-    AND _previous.adjust_campaign IS NULL
-    AND _previous.adjust_creative IS NULL
-    AND _previous.adjust_network IS NULL,
-    _current.adjust_info,
-    STRUCT(
-      _previous.submission_timestamp,
-      _previous.adjust_ad_group,
-      _previous.adjust_campaign,
-      _previous.adjust_creative,
-      _previous.adjust_network
-    )
-  ).*,
-  COALESCE(_previous.install_source, _current.install_source) AS install_source,
-  STRUCT(
-    COALESCE(
-      _previous.metadata.reported_baseline_ping
-      OR _current.metadata.reported_baseline_ping,
-      FALSE
-    ) AS reported_baseline_ping,
-    COALESCE(
-      _previous.metadata.reported_first_session_ping
-      OR _current.metadata.reported_first_session_ping,
-      FALSE
-    ) AS reported_first_session_ping,
-    COALESCE(
-      _previous.metadata.reported_metrics_ping
-      OR _current.metadata.reported_metrics_ping,
-      FALSE
-    ) AS reported_metrics_ping,
-    COALESCE(
-      _previous.metadata.adjust_info__source_ping,
-      _current.metadata.adjust_info__source_ping
-    ) AS adjust_info__source_ping
-  ) AS metadata,
-FROM
-  _current
-FULL OUTER JOIN
-  _previous
-USING
-  (client_id, sample_id)
-LEFT JOIN
-  activations
-USING
-  (client_id)
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	2023-12-01 09:34:54.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/schema.yaml	1970-01-01 00:00:00.000000000 +0000
@@ -1,140 +0,0 @@
-fields:
-
-- mode: NULLABLE
-  name: client_id
-  type: STRING
-  description: |
-    Unique ID for the client installation.
-
-- mode: NULLABLE
-  name: sample_id
-  type: INTEGER
-  description: |
-    Sample ID to limit query results during an analysis.
-
-- mode: NULLABLE
-  name: first_seen_date
-  type: DATE
-  description: |
-    Date when the app first reported a baseline ping for the client.
-
-- mode: NULLABLE
-  name: first_reported_country
-  type: STRING
-  description: |
-    First reported country for the client installation.
-
-- mode: NULLABLE
-  name: first_reported_isp
-  type: STRING
-  description: |
-    Name of the first reported isp (Internet Service Provider).
-
-- mode: NULLABLE
-  name: channel
-  type: STRING
-  description: |
-    Channel where the browser is released.
-
-- mode: NULLABLE
-  name: device_manufacturer
-  type: STRING
-  description: |
-    Manufacturer of the device where the client is installed.
-
-- mode: NULLABLE
-  name: device_model
-  type: STRING
-  description: |
-    Model of the device where the client is installed.
-
-- mode: NULLABLE
-  name: os_version
-  type: STRING
-  description: |
-    Version of the Operating System where the client is originally installed.
-
-- mode: NULLABLE
-  name: app_version
-  type: STRING
-  description: |
-    App display version for this client installation.
-
-- mode: NULLABLE
-  name: locale
-  type: STRING
-  description: |
-    Client's initial locale.
-
-- mode: NULLABLE
-  name: is_activated
-  type: BOOLEAN
-  description: |
-    Determines if a client is activated based on the activation metric and a 7 day lag.
-
-- mode: NULLABLE
-  name: submission_timestamp
-  type: TIMESTAMP
-  description: |
-    Timestamp of the ping which contained the adjust information.
-
-- mode: NULLABLE
-  name: adjust_ad_group
-  type: STRING
-  description: |
-    Structure parameter for the the ad group of a campaign.
-
-- mode: NULLABLE
-  name: adjust_campaign
-  type: STRING
-  description: |
-    Structure parameter for the campaign name.
-
-- mode: NULLABLE
-  name: adjust_creative
-  type: STRING
-  description: |
-    Structure parameter for the creative content of a campaign.
-
-- mode: NULLABLE
-  name: adjust_network
-  type: STRING
-  description: |
-    The type of source of a client installation.
-
-- mode: NULLABLE
-  name: install_source
-  type: STRING
-  description: |
-    This value is only sourced from the metrics ping.
-
-- mode: NULLABLE
-  name: metadata
-  type: RECORD
-  description: |
-    Additional context around the source of this record.
-
-  fields:
-  - mode: NULLABLE
-    name: reported_baseline_ping
-    type: BOOLEAN
-    description: |
-      True if the client reported a baseline_clients_first_seen ping.
-
-  - mode: NULLABLE
-    name: reported_first_session_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a first_session ping.
-
-  - mode: NULLABLE
-    name: reported_metrics_ping
-    type: BOOLEAN
-    description: |
-      True if the client ever reported a metrics ping.
-
-  - mode: NULLABLE
-    name: adjust_info__source_ping
-    type: STRING
-    description: |
-      Ping from which the adjust_info values originate.
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml	2023-12-01 09:34:53.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/telemetry/releases_latest/schema.yaml	2023-12-01 09:27:58.000000000 +0000
@@ -2,21 +2,18 @@
 - name: date
   type: DATE
   mode: NULLABLE
-  description: null
 - name: product
   type: STRING
   mode: NULLABLE
 - name: category
   type: STRING
   mode: NULLABLE
-  description: null
 - name: channel
   type: STRING
   mode: NULLABLE
 - name: build_number
   type: INTEGER
   mode: NULLABLE
-  description: null
 - name: release_date
   type: DATE
   mode: NULLABLE

Link to full diff

@kik-kik kik-kik merged commit 9409d2b into main Dec 1, 2023
18 of 19 checks passed
@kik-kik kik-kik deleted the feat/removing-fenix_derived-firefox-android-clients-v2 branch December 1, 2023 10:16
irrationalagent pushed a commit that referenced this pull request Dec 11, 2023
…lients_v2, v1 will remains the active model (#4610)

* deleting fenix_derived/firefox_android_clients_v2, v1 will remain the active model

* removed fenix_derived.firefox_android_clients_v2 from shredder config
irrationalagent added a commit that referenced this pull request Dec 14, 2023
* android funnel test

* fix filter expression

* fix string comparison

* revise toml

* add completed event

* simplify by using events_unnested

* Funnel fixes

* Bump mkdocs from 1.5.2 to 1.5.3 (#4321)

Bumps [mkdocs](https://github.com/mkdocs/mkdocs) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/mkdocs/mkdocs/releases)
- [Commits](mkdocs/mkdocs@1.5.2...1.5.3)

---
updated-dependencies:
- dependency-name: mkdocs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [RS-826] New job to calculate newtab visits -> activity stream sessions (#4387)

* New job to calculate newtab visits -> activity stream sessions

* Removing newline chars at end of file

* Removing newline chars at end of file

* Removing newline chars at end of file

* Addressing comment suggestions

* Format

* Add bqetl_ads DAG

* Add ACL to nt_visits_to_sessions_conversion_factors_daily_v1

* Add metadata files

* Add view to dry_run skip list

* Oops, fix the view

---------

Co-authored-by: Curtis Morales <cmorales@mozilla.com>

* Allow running multiple checks (#4471)

* Allow running multiple checks

* Don't yield anything on no matches

* Change pocket_available for new Pocket markets (#4472)

* FXA-6721 Setup import of accounts table from FxA production CloudSQL (#4423)

* Urlbar events: nested (long) instead of wide (#4373)

* feat: urlbar events final release

* feat: new result types

* feat: add interaction and group

* fix: date

* fix: use BQ builtin for UUIDs

* Add the view_v2'

* Add new table to the DAG

* fix CI error

fix ci error

* remove teon brooks

* Incorporate feedback by Curtis

Incorporate feedback from Curtis

---------

Co-authored-by: Alekhya Kommasani <akommasani@mozilla.com>
Co-authored-by: Alekhya <88394696+alekhyamoz@users.noreply.github.com>

* DENG-1705 - Add startup_profile_selection_reason_first to clients_daily_v6 (#4473)

* Update experiment export query to include feature ids and branch feature config values (#4477)

* Update experiment export query to include feature ids and branch feature
config value.

* Add view skip for broken view

* add skip to dry run as well

* DENG-476 - Update monitoring ETLs to reference main_v5 (#4431)

* DENG-476 - Update sampled main ping tables to reference main_v5 (#4433)

* DENG-476 - Update experiment aggregates ETL to reference main_v5 (#4435)

* DENG-476 - Update internet outages to reference main_v5 (#4432)

* Fix test for mozfun.norm.result_type_to_product_name (#4487)

* Bug 1860814 -  fix amo_prod__desktop_addons_by_client (#4481)

* quick fix

* fix spread out groupby

* move out sourcetable query

---------

Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>

* fix for #4481 (#4489)

* DENG-1781- Remove urlbar_events_temp_v2 view and repoint urlbar_events view to v2 (#4486)

* Remove urlbar_events_temp_v2 view and repoint urlbar_events view to v2

* Include all sql_gen files in package (#4490)

When the bigquery-etl package is installed from pypi (or locally
via `pip install .`), the only non-py files included in the package
are those in the `package_data` section of setup.py.

Previously, with just those files, sql generation would fail due
to missing files. Because this directory is small, we should
include all files so no one accidentally runs into this problem
again.

Co-authored-by: Daniel Thorn <dthorn@mozilla.com>

* Bump types-requests from 2.31.0.2 to 2.31.0.10 (#4475)

Bumps [types-requests](https://github.com/python/typeshed) from 2.31.0.2 to 2.31.0.10.
- [Commits](https://github.com/python/typeshed/commits)

---
updated-dependencies:
- dependency-name: types-requests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mozilla-metric-config-parser from 2023.9.2 to 2023.10.2 (#4476)

Bumps [mozilla-metric-config-parser](https://github.com/mozilla/metric-config-parser) from 2023.9.2 to 2023.10.2.
- [Release notes](https://github.com/mozilla/metric-config-parser/releases)
- [Commits](mozilla/metric-config-parser@2023.9.2...2023.10.2)

---
updated-dependencies:
- dependency-name: mozilla-metric-config-parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Glean server knobs monitoring table (#4491)

* Glean server knobs monitoring table

* fix code gen and skip dry-run

* Remove view creation in query

* DENG-1879 Setup import of emails table from FxA stage CloudSQL (#4493)

* DENG-1879 Setup import of emails table from FxA prod CloudSQL (#4494)

* Bump jsonschema from 4.19.0 to 4.19.2 (#4495)

Bumps [jsonschema](https://github.com/python-jsonschema/jsonschema) from 4.19.0 to 4.19.2.
- [Release notes](https://github.com/python-jsonschema/jsonschema/releases)
- [Changelog](https://github.com/python-jsonschema/jsonschema/blob/main/CHANGELOG.rst)
- [Commits](python-jsonschema/jsonschema@v4.19.0...v4.19.2)

---
updated-dependencies:
- dependency-name: jsonschema
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akkomar <akkomar@users.noreply.github.com>

* Bump pytest from 7.4.2 to 7.4.3 (#4496)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.4.2 to 7.4.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@7.4.2...7.4.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Enforce no date partition parameter in DAG (#4497)

* Use mozfun.glean.parse_datetime to parse ping_info fields (#4464)

In future versions of Glean that timestamp can be more precise, so we
need to ensure we correctly parse it.

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Remove mmccorquodale from DAG owners (#4492)

* Fix test for norm.glean_ping_info

* Bump black from 23.9.1 to 23.10.1

Bumps [black](https://github.com/psf/black) from 23.9.1 to 23.10.1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.9.1...23.10.1)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump sqlglot from 18.11.4 to 19.0.1 (#4500)

Bumps [sqlglot](https://github.com/tobymao/sqlglot) from 18.11.4 to 19.0.1.
- [Changelog](https://github.com/tobymao/sqlglot/blob/main/CHANGELOG.md)
- [Commits](tobymao/sqlglot@v18.11.4...v19.0.1)

---
updated-dependencies:
- dependency-name: sqlglot
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Materialized views and aggregated tables for event monitoring (#4478)

* WIP event monitoring

* Add FxA custom events to view definition (#4483)

* Add FxA custom events to view definition

* Update sql_generators/event_monitoring/templates/event_monitoring_live.init.sql

* Update sql_generators/event_monitoring/templates/event_monitoring_live.init.sql

* Update sql_generators/event_monitoring/templates/event_monitoring_live.init.sql

* Update sql_generators/event_monitoring/templates/event_monitoring_live.init.sql

---------

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Move event monitoring to glean_usage generator

* Add cross-app event monitoring view

* Generate cross app monitoring

* Simplyfy event monitoring aggregation

---------

Co-authored-by: akkomar <akkomar@users.noreply.github.com>

* Remove generated DAGs from main (#4507)

* Add output_dir to command dag generate. (#4512)

* Add output_dir to command dag generate.

* output_dir to command dag generate.

* output_dir to command dag generate.

---------

Co-authored-by: Lucia Vargas <lvargas@mozilla.com>

* Bump pyarrow from 13.0.0 to 14.0.0 (#4511)

Bumps [pyarrow](https://github.com/apache/arrow) from 13.0.0 to 14.0.0.
- [Commits](apache/arrow@go/v13.0.0...go/v14.0.0)

---
updated-dependencies:
- dependency-name: pyarrow
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pre-commit from 3.4.0 to 3.5.0 (#4510)

Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](pre-commit/pre-commit@v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: pre-commit
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove distinct_docids query (#4449)

* Bump pip from 23.0 to 23.3 (#4516)

Bumps [pip](https://github.com/pypa/pip) from 23.0 to 23.3.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](pypa/pip@23.0...23.3)

---
updated-dependencies:
- dependency-name: pip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mkdocs-material from 9.3.1 to 9.4.7 (#4518)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.3.1 to 9.4.7.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@9.3.1...9.4.7)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Dont generate dags in bqetl query schedule command (#4517)

* Add query to load application information from probe info service (#4508)

* prefixing schema error message inside dryrun to "ERROR" to make it easier to find when searching logs for cause of exit code 1 (#4522)

* updated schema for telemetry_derived/clients_last_seen_joined_v1 to align it with the query results (#4523)

* Update scheduler of aggregates to run after upstreams. (#4503)

* Update scheduler of aggregates to run after upstreams.

* Update dags for new scheduler of analytics_aggregates

* Update dag bqetl_search

* Remove DAG.

---------

Co-authored-by: Lucia Vargas <lvargas@mozilla.com>

* Set depend_on_past=False for warn checks (#4526)

* Add map.set_key to mozfun (#4527)

* Add map.set_key to mozfun

* Disallow NULL keys in maps

* DS-3281 - Add client adclicks history table (#4528)

* Add client adclicks history table

* Add alias to ad_click_history col

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Remove partition parameter on table write

---------

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Add experiment information to event monitoring (#4519)

* feat(DENG-1774): adding fenix derived firefox android clients v2 (#4424)

* added fenix_derirved.firefox_android_clients_v2

* added ETL checks for fenix_derirved.firefox_android_clients_v2

* made changes as suggested by bani in PR#4424

* converting unique check for android clients v2 until duplication is resolved

* added install_source field to firefox_android_clients_v2 and formatting applied on checks

* added locale field and modified the query to suppot is_init()

* removed generated dag due to new generation process

* Add submission_date param to adclicks history (#4531)

* DS-3054. Support running an initialization query in parallel (#4322)

* DS-3054. Create functions to support running an initialization query for all sample_ids in parallel.

* DS-3054. Update _run_query function.

* DS-3054. Use _run_query and mapped values for initialization in parallel.

* DS-3054. Unify initialization to run in parallel and get sample_id range from metadata.

* DS-3054. Minimize formatting of query template and remove need to modify existing initialization queries. Validate if a query should use parallelized or regular update.

* DS-3054. Adding link to caveats.

* DS-3054. Update sample_id range for initialization.

* DS-3054. Use current implementation of run_query.

* DS-3054. Update using a parameter instead of initialization in metadata.

* DS-3054. DAG update with new parameter.

* Pass parameters before calling _run_query().

* Use --append_tablein favour of INSERT INTO.

* DS-3054 Separate parallel and non parallel init, plus some improvements.

---------

Co-authored-by: Lucia Vargas <lvargas@mozilla.com>

* Add ios baseline_clients_yearly (#4506)

* DENG-1935 Change data ordering from pings in clients-first-seen-v2 (#4533)

* DENG-1935 Change data ordering from pings in clients-first-seen-v2
* Added main ping for client-3, maintain chosen ping

* Fix comments in event monitoring queries (#4535)

* DENG-1705 - Add missing client attribution columns to clients daily/first-seen (#4505)

* DENG-1705 Add missing client attribution columns to clients daily/firstseen
* Update clients_last_seen_joined

* Rename main_v4 -> main_v5 in ssl_ratios tests (#4536)

* Make base tables configurable in glean_usage generator (#4534)

* Make base tables configurable in glean_usage generator

* Fix event extras unnesting in event monitoring

* Bump sqlglot from 19.0.1 to 19.0.3 (#4521)

Bumps [sqlglot](https://github.com/tobymao/sqlglot) from 19.0.1 to 19.0.3.
- [Changelog](https://github.com/tobymao/sqlglot/blob/main/CHANGELOG.md)
- [Commits](tobymao/sqlglot@v19.0.1...v19.0.3)

---
updated-dependencies:
- dependency-name: sqlglot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* DS-3272 - Review checker data model for mobile (#4498)

* Add mobile shopping data

* Remove the ff desktop from sql_generator

* Fix build issue

* Incorporate feedback from Bruce

* Add clients table for mobile

* FIX CI issue

* Incorporate Bruce's feedback

* Incorporate Curtis' feedback

* Fix event_monitoring_aggregates_v1 template (#4537)

This will ensure that FxA tables are included in the aggregate.

* Fixing query error in fenix_derived/firefox_android_clients_v2/checks.sql (#4539)

* Add missing clients view to fenix review checker (#4540)

* add other projects to query from for bq usage, add for loop (#4529)

* add other projects to query from for bq usage, add for loop

* create new function to gather jobs_by_project data into temp table, update create_query function to join jobs_by_org table to jobs_by_project tmp table

* take out date from tmp table as it is unnecessary

* refactor to take out irrelevant function, rewrite SQL to look at other projects

* add date filter to jobs_by_project

* add comment for future refactoring

* add tmp_table for jobs_by_project table

* create function to loop through projects for jobs_by_project, revise query to join jobs_by_org with jobs_by_project tmp table

* take out ambiguous DATE filter

* take out r_prefix in regex from query string. Take out tmp table function. Add proper date filter

* take out r_prefix in regex from query string. Take out tmp table function. Add proper date filter

* add back in the r_prefix and add in the extra space in the Query ID regex that was needed

* updated two affected fields across task_instance and trigger airflow metadata tables to type JSON (#4545)

* Fix event monitoring template (#4546)

Nulls need to be casted to string to make the union work.

This will fix https://workflow.telemetry.mozilla.org/log?execution_date=2023-11-09T02%3A00%3A00%2B00%3A00&task_id=monitoring_derived__event_monitoring_aggregates__v1&dag_id=bqetl_monitoring&map_index=-1

* removed check for firefox_ios_clients_v1 which used different filtering settings causing result mismatch (#4547)

* iOS attributable_clients use metrics adclicks (#4543)

* iOS attributable_clients use metrics adclicks

* Remove project id from table name

Co-authored-by: kik-kik <42538694+kik-kik@users.noreply.github.com>

---------

Co-authored-by: kik-kik <42538694+kik-kik@users.noreply.github.com>

* Use correct submission_* field (#4549)

* Use correct app_version field (#4551)

* Revert "updated two affected fields across task_instance and trigger airflow metadata tables to type JSON (#4545)" (#4552)

This reverts commit 9750d33.

* DENG-1705 - Add startup_profile_selection_reason from first ping to clients_daily, clients_first_seen_v2 and downstream (#4482)

* DENG-1705 - Add startup_profile_selection_reason to clients_first_seen

* Add startup_profile_selection_reason_first_ping_only

* Query typo

* Update test schema

* Update sql/moz-fx-data-shared-prod/telemetry_derived/clients_first_seen_28_days_later_v1/schema.yaml

Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>

---------

Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>

* change filter on final query to go back to May 2023 - the min date in the Jobs by Project table as of 11/13/23 (#4559)

* change filter on final query to go back in history

* take out extraneous WHERE

* add DISTINCT to final query

* Add rust result types to product mapping (#4544)

* missing-mobile-fields-review-checker (#4553)

* noting that we are missing some fields

* adding is_fx_dau to android and ios clients

* add missing columns to schema.yaml

add schema.yaml

add schema.yaml

* Delete sql/moz-fx-data-shared-prod/firefox_desktop/serp_events/view.sql

---------

Co-authored-by: Alekhya Kommasani <akommasani@mozilla.com>
Co-authored-by: Alekhya <88394696+alekhyamoz@users.noreply.github.com>

* Add aggregate table to monitor event errors (#4548)

* updated fenix_derived.funnel_retention_clients_* to use clients view instead of table directly (#4563)

* Bug 1864722 - Fix column name typo (#4567)

* add referenced tables to metadata.yaml to make sure jobs_by_org task … (#4568)

* add referenced tables to metadata.yaml to make sure jobs_by_org task runs before bigquery_usage_v2 task

* Update sql/moz-fx-data-shared-prod/monitoring_derived/bigquery_usage_v2/metadata.yaml

Co-authored-by: Sean Rose <1994030+sean-rose@users.noreply.github.com>

---------

Co-authored-by: Sean Rose <1994030+sean-rose@users.noreply.github.com>

* Generate normal task dependencies from `depends_on` if the task is in the same DAG (#4569)

* Generate normal task dependencies from `depends_on` if the task is in the same DAG.

* Update `metadata.yaml` files to use `depends_on` rather than `upstream_dependencies`.

* Add a period-over-period check for revenue data (#4566)

* Check for period over period changes in column sum

* Fix percent change calculation

* Fix errors in navigation function logic

* Rename period over period check to specify revenue

* Remove references to period over period check

---------

Co-authored-by: Alekhya <88394696+alekhyamoz@users.noreply.github.com>

* feat(): updated fenix_derived.firefox_android_clients_v2 to include reported_baseline_ping field (#4565)

* updated fenix_derived.firefox_android_clients_v2 to include reported_baseline_ping field

* Update sql/moz-fx-data-shared-prod/fenix_derived/firefox_android_clients_v2/query.sql

Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>

---------

Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>

* summing sap and ad clicks (#4571)

* remove file that isn't ready yet (#4572)

* Add ga.nullify_string UDF (#4556)

* Add ga.nullify_string UDF

* Add README line

* added fenix_derived.firefox_android_clients_v2 to shredder config (#4564)

* Use client_info.app_channel for event monitoring channels (#4575)

* Add ga_sessions_v1 table & view (#4554)

* Add ga_sessions_v1 table & view

This table aggregates session-level data from GA.

* Rename nullify string func

* Apply suggestions from code review

Co-authored-by: Alexander <anicholson@mozilla.com>

* Add upstream backfill deps

* Move depends_on to correct section

---------

Co-authored-by: Alexander <anicholson@mozilla.com>

* Make sure that metadata `friendly_name` and `description` are not None (#4513)

* Fill empty description

* Assign a friendly name if the table doesn't have one

* Update metadata tests

* Update bigquery_etl/metadata/parse_metadata.py

Co-authored-by: Alexander <anicholson@mozilla.com>

* update test again

---------

Co-authored-by: Alexander <anicholson@mozilla.com>

* Add back normalized_app_id (#4580)

* Add session date param; fix checks CLI bug (#4579)

* Fix checks to filter on partitions

* Don't print "missing checks file" on success

Previously, the statement that checks.sql files
were missing was printed on any execution of the for
statement. ("else" clauses after "for"s execute after
completion of the "for" clause).

Instead, we want to print only when there are no files.

* Add derived stub attribution logs (#4557)

* Add derived stub attribution logs

This table keeps triplets from the stub attribution logs.
The triplet of (dl_token, ga_client_id, stub_session_id)
will only ever appear once here.

See the associated decision brief:
https://docs.google.com/document/d/1L4vOR0nCGawwSRPA9xiR8Hmu_8ozCGUecXAtBWmGGA0/edit

* Move stub attribution table to new dataset

In order to ensure limited access to the stub attribution service
data without significantly decreasing developer velocity, we
move these tables to a new dataset. That dataset has the defaults
we want for all stub attribution log data:
- Defaults to just read access to data-science/DUET workgroup
- No read/write access for DE

We will backfill via the bqetl_backfill DAG.

* Rename view

* Use correct dataset name in view

* Skip dryrun; no access

* Add gclid_conversions table & view (#4558)

* Add gclid_conversions table & view

This table will support the desktop conversion events.
Each valid GCLID will have any associated conversion events.

See the decision brief:
https://docs.google.com/document/d/1T8ArA9r8HDMTj1ES9NHfJFv2gUWo7w0MjG07iXtuUOI

* Use correct table name

* Use new stub attribution dataset; clarify activity_date

* Use correct date_partition_parameter

Co-authored-by: Alexander <anicholson@mozilla.com>

* Include activity_date as parameter

* Use INNER instead of LEFT joins

* Update doc strings to clarify GCLID vs GA Session

---------

Co-authored-by: Alexander <anicholson@mozilla.com>

* Include GA intraday sessions tables (#4582)

* Include GA intraday sessions tables

* Update doc string on backfilling ga_sessions

* Dont dryrun stub_attribution view

* Update min_row_count error text (#4586)

* Add conversion event; fix gclid conversions query (#4584)

* Add first_run conversion; use correct table names

* Ignore dryrun of query and view

* Remove HAVING clause; fix logical_or

* migrates old pingcentre onboarding artifacts to new firefox_desktop view (#4457)

* migrates old pingcentre onboarding artifacts to new firefox_desktop view

* generate event rollup dag

* generate review checker dag

* update messaging system dag

* incl project in table names

---------

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Add ga_clients_v1 table & view (#4560)

* Add ga_clients_v1 table & view

- Query from ga_sessions
- Fix tests

* Use correct scheduling parameters

Co-authored-by: Alexander <anicholson@mozilla.com>

* Move HAVING clause to WHERE

Co-authored-by: Alexander <anicholson@mozilla.com>

* Change CTE name

Co-authored-by: Alexander <anicholson@mozilla.com>

---------

Co-authored-by: Alexander <anicholson@mozilla.com>

* Remove duplicate BQ query param (#4587)

* Firefox ios adclicks (#4585)

* Add Firefox iOS client adclicks history

* Add metadata description to view

* DS-3272 - Fix review checker clients to remove dups (#4583)

* Fix review checker clients to remove dups

* Fix CI issues

* Add row_num filter

* add submission_date to partition

* remove submission_date from partition

* Account for NULL handling in joins (#4590)

Previously, NULL values in the join keys didn't join, resulting
in duplicate rows. This change will coalesce those to empty
strings and NULLIFY them in the view.

* Bug 1865716 - Include errorGroups in legacy docker_fxa_admin_server_sanitized query (#4589)

`errorGroups` field was added in `docker_fxa_admin_server_sanitized_v2` and breaks the UNION.

* DS-3361. Update documentation of initialize command. (#4592)

Co-authored-by: Lucia Vargas <lvargas@mozilla.com>

* Link to full diff in git comments (#4593)

* Link to full diff in git comments

* Show full diff of new and deleted files

* Correct DAG description as DAG is currently active. (#4596)

Co-authored-by: Lucia Vargas <lvargas@mozilla.com>

* Login funnel conversions (#4591)

* Mozilla accounts login funnel conversion for overall, with email confirmation, and with two factor authentication

* Update sql_generators/funnels/configs/login_funnels.toml

* Update sql_generators/funnels/configs/login_funnels.toml

---------

Co-authored-by: Kimberly Siegler <kimberlysiegler@Kimberlys-MBP-2.attlocal.net>
Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Use live tables to determine deletion request ping volume (#4442)

* Increase no_output_timeout for long-running CI jobs (#4602)

* SVCSE-1595 Setup import of tables from staging FxA databases (#4578)

* In generated diffs explicitly list the files being added or deleted. (#4600)

* Glam accounts for sampling when calculating sample_count for windows & release probes (#4581)

* Glam - fix legacy windows & release probes' sample count going fwd

* Glam FOG accounts for sampling when calculating total_sample for windows & release probes

* fog - fix client count and sample count

* Add channel filtering for fog

* SVCSE-1595 Setup import of tables from production FxA databases (#4597)

* Bug 1866469 - Exclude use_counters from GLAM ETL (#4603)

* Bug 1866469 - Exclude use_counters from GLAM ETL

* Attempt to fix tests

---------

Co-authored-by: Eduardo Filho <edugomfilho@gmail.com>

* feat(): updating fxa android funnel to support install_source filtering downstream (#4561)

* Added a filter to only include playstore data

In keeping the bottom of the funnel consistent with the upper funnel, we have to only include installs from play store in the bottom of the funnel metrics

* for fenix_derived.funnel_retention_clients_week_* tables making sure we only include playstore users

* updating the changes as requested by soGaussian to expose to users the install_source field to enable filtering

---------

Co-authored-by: richard baffour <baffour345@gmail.com>

* Add schema.yaml to urlbar_events (sql_generator) (#4595)

* Add schema.yaml to urlbar_events

* SVCSE-1595 Update accounts_db schemas to match deployed tables. (#4604)

* SVCSE-1595 Update more accounts_db schemas to match deployed tables (#4605)

* Fix num_chars_typed in urlbar_events schema (#4607)

* Add init clause to ga_clients table (#4611)

* Give census access to gclid conversions data (#4613)

* Don't nest SQL generated from `main` branch in extra `sql` directory. (#4614)

* Add desktop_acquisition_funnel view (#4616)

* Add desktop_acquisition_funnel view

* Update reference

* Update view.sql

Took out some of the TODO comments around naming to stay consistent with the table it is reading as well as reduce effort to make changes to the spoke-default view that is currently setup with test data.

---------

Co-authored-by: gkabbz <gkabbz@gmail.com>

* added ETL checks to fenix_derived.firefox_android_clients_v1 (#4609)

* DENG-2013 - Add explicit dependencies & checks for history (#4620)

* Fix the source table to point to unified view to include all apps (#4622)

* Deng 1662 move google ads to ads google mmc connector (#4525)

* DENG-1662 move from google_ads connector to ads_google_mmc connector

* format queries

* add code for cohort_daily_statistics using clients_first_seen_v2 with… (#4404)

* add code for cohort_daily_statistics using clients_first_seen_v2 with new columns from clients_first_seen_v2

* take out extra sample_id

* Update sql/moz-fx-data-shared-prod/telemetry_derived/cohort_daily_stats_clients_frst_seen_v2/query.sql

switching column names - original was swapped

Co-authored-by: Alexander <anicholson@mozilla.com>

* update column names- change cohort_date to first_seen_date, make more descriptive; take out client_id and sample_id in the final table; take out extraneous columns that are not used in final table

* fix group by - days_seen_bits not days_interacted_bits

* take out second_seen_date, irrelevant

* change date _activity to submission_date

* replace submission_date_activity with client_activity

* add new line at end of schema.yaml file

* refactor code to use clients_first_seen_v2, originally commited cohorts_daily_statistics_v1 code in the v2 file

* add cohort_daily_statistics_v2 job to DAG

* add cohort_daily_statistics_v2 job to DAG, take out submission_date and add activity_date to query.sql

* delete now needless dags folder

* correct alias of table

* change submission_date to activity_date

* fix column name apple_model to apple_model_id

* add days_seen_dau_bits and other calculations based on this

* add attribution_dlsource to table

* take out underscore from column name, attribution_dlsource

* revise comment - 196 days not 180 days

* add all the other columns from clients_first_seen_v2, update schema.yaml file with new columns

* take out sample_id, fix schema

* take out document_id, dl_token, app_build_id columns, rename activity_date to submission_date, rename cohort_date to first_seen_date to match clients_first_seen_28_days_later

* move files from cohort_daily_statistics_v2 to desktop_cohort_daily_retention_v1 to reflect name change, take out extraneous colums such as xpcom_abi, attribution_dlsource, engine_data columns

---------

Co-authored-by: Alexander <anicholson@mozilla.com>

* add --project_id command, take out extraneous dashes in start and end commands in creating dataset cookbook (#4626)

* change docs (#4629)

* fix typo in project name (#4628)

* fix typo in project name

* remove shared-prod project from sql for google_ads_derived

* Fixes #4624 - Add a view for firefox_desktop.broken_site_report (#4625)

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Separate Airflow tasks for glean_usage (#4588)

* Add support for assigning Airflow tasks to task groups

* Generate separate Airflow tasks for glean_usage

* Remove Airflow dependencies from old glean_usage tasks

* Update dataset_metadata.yaml for broken site reports (#4630)

* Add user-facing view to fxa_oauth.clients (#4623)

* Fix jinja templating in glean usage metadata (#4636)

* feat(DENG-1774 / cancelled): deleting fenix_derived/firefox_android_clients_v2, v1 will remains the active model (#4610)

* deleting fenix_derived/firefox_android_clients_v2, v1 will remain the active model

* removed fenix_derived.firefox_android_clients_v2 from shredder config

* firefox_ios source added to shredder config (#4638)

* Skip check for baseline_clients_last_seen for Fire TV (#4640)

* Resolve correct task_id for tasks nested in a group (#4637)

* Android LTV UDFs (#4633)

* Add Android State UDF

* Add Android Markov States UDFs for LTV

* Make docstrings consistent

* Update doc string

Co-authored-by: Leif Oines <leifdoines@gmail.com>

---------

Co-authored-by: Leif Oines <leifdoines@gmail.com>

* Migrated DIM checks over to ETL checks for internet_outages.global_outages_v1 (#4639)

* Speed up glean_usage generation by caching the table getter (#4644)

`get_tables` is deterministic under the assumption that the tables don't
change in between invocations. Which I hope holds here.
We therefore can just cache that value so that subsequent runs quickly
return without needing a roundtrip to BigQuery again.

* fixing broken test for firefox_ios_derived.baseline_clients_yearly_v1 (#4645)

* Feat/deng 2046/migrating telemetry derived active users aggregates v1 dim checks to etl checks (#4641)

* Migrated DIM checks over to ETL checks for telemetry_derived.active_users_aggregates_v1

* rewrite

* code review suggestions

* add doc

* rename

---------

Co-authored-by: kik-kik <kignasiak@mozilla.com>

* Minimize previous PR diff comments when CI posts a new diff comment (#4635)

* Minimize previous PR diff comments when CI posts a new diff comment.

* Update Node image to latest version available from CircleCI and pin Node packages.

* GLAM avoid scientific notation for big sample counts (#4647)

* GLAM avoid scientific notation for big sample counts

* Cast to bignumeric instead of numeric

* feat(DENG-2083): added firefox_ios_derived.clients_activation_v1 and corresponding view (#4631)

* added firefox_ios_derived.clients_activation_v1 and corresponding view

* fixing a missing seperator in firefox_ios_derived.clients_activation_v1 checks

* adding firefox_ios_derived.clients_activation_v1 to shredder configuration

* removed is_suspicious_device_client as it should not be there, thanks bani for pointing this out

* fixed black formatting error inside shredder/config.py

* applied bqetl formatting

* minor styling tweak as suggested by bani in PR#4631

* Remove baseline_clients_daily DAG dependency for FF ios baseline clients yearly (#4651)

* Support offset backfills, require metadata  (#4627)

* Skip backfills for queries without metadata.yaml

* Support date_partition_offset

* Fixed exclude, modified exception

* Add test for offset backfill

* Apply suggestions from code review

Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>

* Formatting

---------

Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>

* add dau_clients_days_since_seen to CTE and num_clients_dau_on_day column to table in query and schema (#4652)

* Docs: Avoid newline in link

mkdocs doesn't like that newline and will treat the URL as a relative URL, thus breaking the link

* Docs: Use 3rd level heading for UDFs

mkdocs' ToC generator will stop when the header level goes up again.
Because the UDF name itself is generated as a first level heading, any
UDF with a first-level header documentation will thus stop rendering any
subsequent headers.
Most notably on /mozfun/hist where only the very first UDF got a ToC
entry.

* Docs: Link to section on the same page

The separate chapter was removed in #4293

* Migrated DIM checks over to ETL checks for telemetry_derived.unified_metrics_v1 (#4649)

* feat(DENG-2120): migrated over checks defined in DIM for baseline_clients_last_seen fenix. (#4656)

* migrated over checks defined in DIM for this type of dataset

* Update sql_generators/glean_usage/templates/baseline_clients_last_seen_v1.checks.sql

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

---------

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Create tables that have state values per day (#4634)

* Create tables that have state values per day

* Change Airflow DAG

* Move markov states to cols rather than array

* Move bot/bad client filter to materialized table

* Add install_source and consecutive_days_seen features

* Add field to CTE

* Use jinja vars instead of sql variables

* Use correct UDF incantation

* Use live tables for structured error counts (#4598)

* Use live tables for structured error counts

* Prevent from old records being deleted

* Fix structured_error_counts query (#4659)

* Authorize view and add workgroup access for taskcluster (#4661)

* Add metadata.yaml for socorro_crash_v2 (#4664)

* Temporarily add curtis to CODEOWNERS until he can be added to group (#4665)

* Add clients_daily_joined view (#4660)

* add view.sql to telemetry and desktop_cohort_daily_retention view (#4666)

* Skip accounts_db.fxa_oauth_clients in view validation (#4667)

* Public GLAM datasets (#4606)

* Public GLAM datasets

* Remove Fenix GLAM datasets

* DENG-1352 - Migrate contextual services ETL to desktop glean pings (#4474)

* Have `bqetl query` commands fail if they don't find a matching query (#4662)

* Have `bqetl query` commands fail if they don't find a matching query.

* Update `test_run_query_no_query_file` test.

* Skip accounts_db.fxa_oauth_clients dryrun (#4671)

* Remove referenced_table from firefox_android_clients (#4674)

* Define `event_monitoring_live_v1` views in `view.sql` files (#4576)

* Define `event_monitoring_live_v1` views in `view.sql` files.

So they get automatically deployed by the `bqetl_artifact_deployment.publish_views` Airflow task.

* Support materialized views in view naming validation.

* Handle `IF NOT EXISTS` in view naming validation.

* Use regular expression to extract view ID in view naming validation.

This simplifies the logic and avoids a sqlparse bug where it doesn't recognize the `MATERIALIZED` keyword.

* Update other view regular expressions to allow for materialized views.

* Add state location for US & Canadian VPN subscriptions (DENG-2099) (#4675)

* add triage/confidential tag to docs (#4678)

* feat(DENG-2156): added value_length check and updated some of the ETL checks to use the macro (#4672)

* added value_length check and updated some of the ETL checks to use the macro

* added the new check macro to the data checks docs

* implemented lelilia feedback from PR#4672

* simplified the sql logic for the value_length check

* Skipping copying checks for baseline tables for apps marked as not receiving the baseline ping (#4670)

Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>

* Revert "Define `event_monitoring_live_v1` views in `view.sql` files (#4576)" (#4680)

This reverts commit 2c4cc5e.

* Change directory to generate private DAGs so `sql_file_path` values are relative to the repo root. (#4668)

* `cd` into `private-bigquery-etl` repo when generating DAGs.

To avoid generated DAGs having incorrect absolute paths for ETLs using SQL scripts.

* Revert "Temporarily add curtis to CODEOWNERS until he can be added to group (#4665)" (#4669)

This reverts commit 8d94a86.

* ci-fix Ignore dataset.update required permissions when dryrunning authorized views (#4681)

* Refactor, add typehint
* Add datasets.update clause denied for authorized views

* add country dimension

* remove generated and old files

* delete genertated files

* regenerate sql and delete more files

* last edits to android funnel before review

* change description fields

* modify config to add retention outcomes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Anna Scholtz <anna@scholtzan.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sergio E. Betancourt <37666064+sergiosonline@users.noreply.github.com>
Co-authored-by: Curtis Morales <cmorales@mozilla.com>
Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>
Co-authored-by: m-d-bowerman <107562575+m-d-bowerman@users.noreply.github.com>
Co-authored-by: akkomar <akkomar@users.noreply.github.com>
Co-authored-by: Rebecca BurWei <rebecca.burwei@gmail.com>
Co-authored-by: Alekhya Kommasani <akommasani@mozilla.com>
Co-authored-by: Alekhya <88394696+alekhyamoz@users.noreply.github.com>
Co-authored-by: Alexander <anicholson@mozilla.com>
Co-authored-by: wil stuckey <wstuckey@mozilla.com>
Co-authored-by: Daniel Thorn <dthorn@mozilla.com>
Co-authored-by: Leli <33942105+lelilia@users.noreply.github.com>
Co-authored-by: Jan-Erik Rediger <jrediger@mozilla.com>
Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>
Co-authored-by: Lucia Vargas <lvargas@mozilla.com>
Co-authored-by: kik-kik <42538694+kik-kik@users.noreply.github.com>
Co-authored-by: Marlene Hirose <92952117+Marlene-M-Hirose@users.noreply.github.com>
Co-authored-by: David Zeber <dzeber@mozilla.com>
Co-authored-by: betling <betling@mozilla.com>
Co-authored-by: Sean Rose <1994030+sean-rose@users.noreply.github.com>
Co-authored-by: Linh Nguyen <linhnguyen@mozilla.com>
Co-authored-by: Mike Williams <102263964+mikewilli@users.noreply.github.com>
Co-authored-by: ksiegler1 <ksiegler@mozilla.com>
Co-authored-by: Kimberly Siegler <kimberlysiegler@Kimberlys-MBP-2.attlocal.net>
Co-authored-by: Eduardo Filho <edugomfilho@gmail.com>
Co-authored-by: richard baffour <baffour345@gmail.com>
Co-authored-by: gkabbz <gkabbz@gmail.com>
Co-authored-by: Ksenia <kberezina@mozilla.com>
Co-authored-by: kik-kik <kignasiak@mozilla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants