Skip to content

Conversation

@kbammarito
Copy link
Contributor

Description

This PR adds mobile to events_first_seen, optimizes the query and refactors code

Related Tickets & Documents

Reviewer, please follow this checklist

@dataops-ci-bot

This comment has been minimized.

@kbammarito kbammarito changed the title Deng 10365 add mobile to events first seen feat(DENG-10365): add mobile to events first seen Dec 26, 2025
@kbammarito kbammarito changed the title feat(DENG-10365): add mobile to events first seen feat(DENG-10365): add mobile to events_first_seen Dec 26, 2025
remove null as special criteria name and simplify join condition
encode criteria as dictionary
update tests
@dataops-ci-bot

This comment has been minimized.

… need to overwrite entire table)

update tests and metadata
@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@kbammarito kbammarito requested review from a team and sean-rose January 2, 2026 23:30
@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot

This comment has been minimized.

@dataops-ci-bot
Copy link

Integration report for "Merge branch 'main' into DENG-10365-add-mobile-to-events-first-seen"

sql.diff

Click to expand!
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	2026-01-06 00:03:10.000000000 +0000
+++ /tmp/workspace/generated-sql/dags/bqetl_glean_usage.py	2026-01-06 00:05:28.000000000 +0000
@@ -3797,9 +3797,8 @@
             "[email protected]",
             "[email protected]",
         ],
-        date_partition_parameter=None,
+        date_partition_parameter="submission_date",
         depends_on_past=True,
-        parameters=["submission_date:DATE:{{ds}}"],
         task_group=task_group_firefox_desktop,
     )
 
@@ -5211,6 +5210,23 @@
         task_group=task_group_fenix,
     )
 
+    org_mozilla_fenix_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_fenix_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_fenix_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_fenix,
+    )
+
     org_mozilla_fenix_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_fenix_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -5297,6 +5313,23 @@
         )
     )
 
+    org_mozilla_fenix_nightly_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_fenix_nightly_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_fenix_nightly_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_fenix,
+    )
+
     org_mozilla_fenix_nightly_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_fenix_nightly_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -5383,6 +5416,23 @@
         )
     )
 
+    org_mozilla_fennec_aurora_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_fennec_aurora_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_fennec_aurora_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_fenix,
+    )
+
     org_mozilla_fennec_aurora_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_fennec_aurora_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -5471,6 +5521,23 @@
         )
     )
 
+    org_mozilla_firefox_beta_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_firefox_beta_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_firefox_beta_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_fenix,
+    )
+
     org_mozilla_firefox_beta_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_firefox_beta_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -5555,6 +5622,23 @@
         task_group=task_group_fenix,
     )
 
+    org_mozilla_firefox_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_firefox_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_firefox_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_fenix,
+    )
+
     org_mozilla_firefox_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_firefox_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -5941,6 +6025,23 @@
         task_group=task_group_firefox_ios,
     )
 
+    org_mozilla_ios_fennec_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_ios_fennec_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_ios_fennec_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_firefox_ios,
+    )
+
     org_mozilla_ios_fennec_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_ios_fennec_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -6029,6 +6130,23 @@
         )
     )
 
+    org_mozilla_ios_firefox_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_ios_firefox_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_ios_firefox_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_firefox_ios,
+    )
+
     org_mozilla_ios_firefox_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_ios_firefox_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -6115,6 +6233,23 @@
         task_group=task_group_firefox_ios,
     )
 
+    org_mozilla_ios_firefoxbeta_derived__events_first_seen__v1 = bigquery_etl_query(
+        task_id="org_mozilla_ios_firefoxbeta_derived__events_first_seen__v1",
+        destination_table="events_first_seen_v1",
+        dataset_id="org_mozilla_ios_firefoxbeta_derived",
+        project_id="moz-fx-data-shared-prod",
+        owner="[email protected]",
+        email=[
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+            "[email protected]",
+        ],
+        date_partition_parameter="submission_date",
+        depends_on_past=True,
+        task_group=task_group_firefox_ios,
+    )
+
     org_mozilla_ios_firefoxbeta_derived__events_stream__v1 = bigquery_etl_query(
         task_id="org_mozilla_ios_firefoxbeta_derived__events_stream__v1",
         destination_table="events_stream_v1",
@@ -8099,6 +8234,10 @@
         bigeye__org_mozilla_fenix_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_fenix_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_fenix_derived__events_stream__v1
+    )
+
     org_mozilla_fenix_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8123,6 +8262,10 @@
         bigeye__org_mozilla_fenix_nightly_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_fenix_nightly_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_fenix_nightly_derived__events_stream__v1
+    )
+
     org_mozilla_fenix_nightly_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8147,6 +8290,10 @@
         bigeye__org_mozilla_fennec_aurora_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_fennec_aurora_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_fennec_aurora_derived__events_stream__v1
+    )
+
     org_mozilla_fennec_aurora_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8171,6 +8318,10 @@
         bigeye__org_mozilla_firefox_beta_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_firefox_beta_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_firefox_beta_derived__events_stream__v1
+    )
+
     org_mozilla_firefox_beta_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8195,6 +8346,10 @@
         bigeye__org_mozilla_firefox_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_firefox_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_firefox_derived__events_stream__v1
+    )
+
     org_mozilla_firefox_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8311,6 +8466,10 @@
         bigeye__org_mozilla_ios_fennec_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_ios_fennec_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_ios_fennec_derived__events_stream__v1
+    )
+
     org_mozilla_ios_fennec_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8335,6 +8494,10 @@
         bigeye__org_mozilla_ios_firefox_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_ios_firefox_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_ios_firefox_derived__events_stream__v1
+    )
+
     org_mozilla_ios_firefox_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
@@ -8359,6 +8522,10 @@
         bigeye__org_mozilla_ios_firefoxbeta_derived__baseline_clients_daily__v1
     )
 
+    org_mozilla_ios_firefoxbeta_derived__events_first_seen__v1.set_upstream(
+        org_mozilla_ios_firefoxbeta_derived__events_stream__v1
+    )
+
     org_mozilla_ios_firefoxbeta_derived__events_stream__v1.set_upstream(
         wait_for_copy_deduplicate_all
     )
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.fenix.active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.fenix.firefox_android_clients.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4: moz-fx-data-shared-prod.telemetry.desktop_active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.firefox_ios.active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.firefox_ios.firefox_ios_clients.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.firefox_ios.metrics_clients_last_seen.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_ios_derived/active_users_aggregates_v3: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.focus_android.active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.focus_android.metrics_clients_last_seen.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_android_derived/active_users_aggregates_v3: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.focus_ios.active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.focus_ios.metrics_clients_last_seen.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/focus_ios_derived/active_users_aggregates_v3: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.klar_android.active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.klar_android.metrics_clients_last_seen.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_android_derived/active_users_aggregates_v3: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.klar_ios.active_users.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: moz-fx-data-shared-prod.klar_ios.metrics_clients_last_seen.schema.json
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: test_active_users_combinations
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: test_city_and_activity_segment
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: test_country_and_first_seen_year
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: test_os_version_build
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/klar_ios_derived/active_users_aggregates_v3: test_os_version_major_minor
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_fenix: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_fenix_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_fenix_nightly: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_fenix_nightly_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_fennec_aurora: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_fennec_aurora_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_firefox: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_firefox_beta: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_firefox_beta_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_firefox_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_fennec: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_fennec_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_firefox: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_firefoxbeta: events_first_seen
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_firefoxbeta_derived: events_first_seen_v1
Only in /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/org_mozilla_ios_firefox_derived: events_first_seen_v1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/metadata.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/metadata.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/metadata.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/metadata.yaml	2026-01-06 00:02:03.000000000 +0000
@@ -0,0 +1,18 @@
+friendly_name: Events First Seen
+description: |-
+  Please provide a description for the query
+owners: []
+labels: {}
+workgroup_access:
+- role: roles/bigquery.dataViewer
+  members:
+  - workgroup:mozilla-confidential
+references:
+  view.sql:
+  - moz-fx-data-shared-prod.org_mozilla_fenix.events_first_seen
+  - moz-fx-data-shared-prod.org_mozilla_fenix_nightly.events_first_seen
+  - moz-fx-data-shared-prod.org_mozilla_fennec_aurora.events_first_seen
+  - moz-fx-data-shared-prod.org_mozilla_firefox.events_first_seen
+  - moz-fx-data-shared-prod.org_mozilla_firefox_beta.events_first_seen
+require_column_descriptions: false
+level: null
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/view.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/view.sql
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/view.sql	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix/events_first_seen/view.sql	2026-01-06 00:00:22.000000000 +0000
@@ -0,0 +1,43 @@
+-- Generated via bigquery_etl.glean_usage
+CREATE OR REPLACE VIEW
+  `moz-fx-data-shared-prod.fenix.events_first_seen`
+AS
+WITH events_first_seen_union AS (
+  SELECT
+    "org_mozilla_firefox" AS normalized_app_id,
+    * REPLACE ("release" AS normalized_channel)
+  FROM
+    `moz-fx-data-shared-prod.org_mozilla_firefox.events_first_seen`
+  UNION ALL
+    BY NAME
+  SELECT
+    "org_mozilla_firefox_beta" AS normalized_app_id,
+    * REPLACE ("beta" AS normalized_channel)
+  FROM
+    `moz-fx-data-shared-prod.org_mozilla_firefox_beta.events_first_seen`
+  UNION ALL
+    BY NAME
+  SELECT
+    "org_mozilla_fenix" AS normalized_app_id,
+    * REPLACE ("nightly" AS normalized_channel)
+  FROM
+    `moz-fx-data-shared-prod.org_mozilla_fenix.events_first_seen`
+  UNION ALL
+    BY NAME
+  SELECT
+    "org_mozilla_fenix_nightly" AS normalized_app_id,
+    * REPLACE ("nightly" AS normalized_channel)
+  FROM
+    `moz-fx-data-shared-prod.org_mozilla_fenix_nightly.events_first_seen`
+  UNION ALL
+    BY NAME
+  SELECT
+    "org_mozilla_fennec_aurora" AS normalized_app_id,
+    * REPLACE ("nightly" AS normalized_channel)
+  FROM
+    `moz-fx-data-shared-prod.org_mozilla_fennec_aurora.events_first_seen`
+)
+SELECT
+  *
+FROM
+  events_first_seen_union
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.active_users.schema.json /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.active_users.schema.json
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.active_users.schema.json	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.active_users.schema.json	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,364 @@
+[
+  {
+    "type": "STRING",
+    "name": "segment"
+  },
+  {
+    "type": "STRING",
+    "name": "normalized_app_id"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_since_seen"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_since_active"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_since_created_profile"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_since_seen_session_start"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_since_seen_session_end"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_since_visited_1_uri"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_seen_bits"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_active_bits"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_created_profile_bits"
+  },
+  {
+    "type": "DATE",
+    "name": "submission_date"
+  },
+  {
+    "type": "STRING",
+    "name": "client_id"
+  },
+  {
+    "type": "INTEGER",
+    "name": "sample_id"
+  },
+  {
+    "type": "DATE",
+    "name": "first_run_date"
+  },
+  {
+    "type": "INTEGER",
+    "name": "durations"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_seen_session_start_bits"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_seen_session_end_bits"
+  },
+  {
+    "type": "STRING",
+    "name": "normalized_channel"
+  },
+  {
+    "type": "STRING",
+    "name": "normalized_os"
+  },
+  {
+    "type": "STRING",
+    "name": "normalized_os_version"
+  },
+  {
+    "type": "STRING",
+    "name": "android_sdk_version"
+  },
+  {
+    "type": "STRING",
+    "name": "locale"
+  },
+  {
+    "type": "STRING",
+    "name": "city"
+  },
+  {
+    "type": "STRING",
+    "name": "country"
+  },
+  {
+    "type": "STRING",
+    "name": "app_build"
+  },
+  {
+    "type": "STRING",
+    "name": "app_channel"
+  },
+  {
+    "type": "STRING",
+    "name": "app_display_version"
+  },
+  {
+    "type": "STRING",
+    "name": "architecture"
+  },
+  {
+    "type": "STRING",
+    "name": "device_manufacturer"
+  },
+  {
+    "type": "STRING",
+    "name": "device_model"
+  },
+  {
+    "type": "STRING",
+    "name": "telemetry_sdk_build"
+  },
+  {
+    "type": "DATE",
+    "name": "first_seen_date"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_new_profile"
+  },
+  {
+    "type": "STRING",
+    "name": "distribution_id"
+  },
+  {
+    "type": "STRING",
+    "name": "geo_subdivision"
+  },
+  {
+    "type": "STRING",
+    "name": "profile_group_id"
+  },
+  {
+    "type": "STRING",
+    "name": "install_source"
+  },
+  {
+    "type": "INTEGER",
+    "name": "windows_build_number"
+  },
+  {
+    "type": "INTEGER",
+    "name": "browser_engagement_uri_count"
+  },
+  {
+    "type": "INTEGER",
+    "name": "browser_engagement_active_ticks"
+  },
+  {
+    "type": "STRING",
+    "name": "legacy_telemetry_client_id"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_default_browser"
+  },
+  {
+    "type": "RECORD",
+    "name": "attribution",
+    "fields": [
+      {
+        "type": "STRING",
+        "name": "campaign"
+      },
+      {
+        "type": "STRING",
+        "name": "content"
+      },
+      {
+        "type": "STRING",
+        "name": "medium"
+      },
+      {
+        "type": "STRING",
+        "name": "source"
+      },
+      {
+        "type": "STRING",
+        "name": "term"
+      }
+    ]
+  },
+  {
+    "type": "RECORD",
+    "name": "distribution",
+    "fields": [
+      {
+        "type": "STRING",
+        "name": "name"
+      }
+    ]
+  },
+  {
+    "type": "STRING",
+    "name": "attribution_dltoken"
+  },
+  {
+    "type": "STRING",
+    "name": "attribution_dlsource"
+  },
+  {
+    "type": "STRING",
+    "name": "attribution_experiment"
+  },
+  {
+    "type": "STRING",
+    "name": "attribution_variation"
+  },
+  {
+    "type": "STRING",
+    "name": "attribution_ua"
+  },
+  {
+    "type": "RECORD",
+    "name": "experiments",
+    "fields": [
+      {
+        "type": "STRING",
+        "name": "key"
+      },
+      {
+        "type": "RECORD",
+        "name": "value",
+        "fields": [
+          {
+            "type": "STRING",
+            "name": "branch"
+          },
+          {
+            "type": "RECORD",
+            "name": "extra",
+            "fields": [
+              {
+                "type": "STRING",
+                "name": "type"
+              },
+              {
+                "type": "STRING",
+                "name": "enrollment_id"
+              }
+            ]
+          }
+        ]
+      }
+    ]
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_visited_1_uri_bits"
+  },
+  {
+    "type": "FLOAT",
+    "name": "active_hours_sum"
+  },
+  {
+    "type": "STRING",
+    "name": "startup_profile_selection_reason_first"
+  },
+  {
+    "type": "STRING",
+    "name": "app_name"
+  },
+  {
+    "type": "STRING",
+    "name": "activity_segment"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_dau"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_wau"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_mau"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_daily_user"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_weekly_user"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_monthly_user"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_mobile"
+  },
+  {
+    "type": "STRING",
+    "name": "isp"
+  },
+  {
+    "type": "STRING",
+    "name": "device_type"
+  },
+  {
+    "type": "INTEGER",
+    "name": "first_seen_year"
+  },
+  {
+    "type": "STRING",
+    "name": "app_version"
+  },
+  {
+    "type": "NUMERIC",
+    "name": "app_version_major"
+  },
+  {
+    "type": "NUMERIC",
+    "name": "app_version_minor"
+  },
+  {
+    "type": "NUMERIC",
+    "name": "app_version_patch_revision"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "app_version_is_major_release"
+  },
+  {
+    "type": "STRING",
+    "name": "os"
+  },
+  {
+    "type": "STRING",
+    "name": "os_version"
+  },
+  {
+    "type": "INTEGER",
+    "name": "os_version_major"
+  },
+  {
+    "type": "INTEGER",
+    "name": "os_version_minor"
+  },
+  {
+    "type": "STRING",
+    "name": "channel"
+  }
+]
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.firefox_android_clients.schema.json /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.firefox_android_clients.schema.json
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.firefox_android_clients.schema.json	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.firefox_android_clients.schema.json	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,232 @@
+[
+  {
+    "type": "DATE",
+    "name": "first_seen_date"
+  },
+  {
+    "type": "STRING",
+    "name": "client_id"
+  },
+  {
+    "type": "INTEGER",
+    "name": "sample_id"
+  },
+  {
+    "type": "DATE",
+    "name": "submission_date"
+  },
+  {
+    "type": "DATE",
+    "name": "first_run_date"
+  },
+  {
+    "type": "STRING",
+    "name": "first_reported_country"
+  },
+  {
+    "type": "STRING",
+    "name": "first_reported_isp"
+  },
+  {
+    "type": "STRING",
+    "name": "channel"
+  },
+  {
+    "type": "STRING",
+    "name": "device_manufacturer"
+  },
+  {
+    "type": "STRING",
+    "name": "device_model"
+  },
+  {
+    "type": "STRING",
+    "name": "os_version"
+  },
+  {
+    "type": "STRING",
+    "name": "app_version"
+  },
+  {
+    "type": "STRING",
+    "name": "locale"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "activated"
+  },
+  {
+    "type": "STRING",
+    "name": "adjust_campaign"
+  },
+  {
+    "type": "STRING",
+    "name": "adjust_ad_group"
+  },
+  {
+    "type": "STRING",
+    "name": "adjust_creative"
+  },
+  {
+    "type": "STRING",
+    "name": "distribution_id"
+  },
+  {
+    "type": "STRING",
+    "name": "meta_attribution_app"
+  },
+  {
+    "type": "STRING",
+    "name": "play_store_attribution_campaign"
+  },
+  {
+    "type": "STRING",
+    "name": "play_store_attribution_content"
+  },
+  {
+    "type": "STRING",
+    "name": "play_store_attribution_medium"
+  },
+  {
+    "type": "STRING",
+    "name": "play_store_attribution_source"
+  },
+  {
+    "type": "STRING",
+    "name": "play_store_attribution_term"
+  },
+  {
+    "type": "STRING",
+    "name": "play_store_attribution_install_referrer_response"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_adjust_campaign"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_adjust_ad_group"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_adjust_creative"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_adjust_network"
+  },
+  {
+    "type": "DATE",
+    "name": "last_reported_date"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_channel"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_country"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_device_model"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_device_manufacturer"
+  },
+  {
+    "type": "STRING",
+    "name": "last_reported_locale"
+  },
+  {
+    "fields": [
+      {
+        "type": "BOOLEAN",
+        "name": "reported_first_session_ping"
+      },
+      {
+        "type": "BOOLEAN",
+        "name": "reported_metrics_ping"
+      },
+      {
+        "type": "BOOLEAN",
+        "name": "reported_baseline_ping"
+      },
+      {
+        "type": "DATE",
+        "name": "min_first_session_ping_submission_date"
+      },
+      {
+        "type": "DATE",
+        "name": "min_first_session_ping_run_date"
+      },
+      {
+        "type": "DATE",
+        "name": "min_metrics_ping_submission_date"
+      },
+      {
+        "type": "STRING",
+        "name": "adjust_network__source_ping"
+      },
+      {
+        "type": "STRING",
+        "name": "install_source__source_ping"
+      },
+      {
+        "type": "DATETIME",
+        "name": "adjust_network__source_ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "install_source__source_ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "play_store_attribution_campaign__ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "play_store_attribution_content__ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "play_store_attribution_medium__ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "play_store_attribution_source__ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "play_store_attribution_term__ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "play_store_attribution_install_referrer_response__ping_datetime"
+      },
+      {
+        "type": "DATETIME",
+        "name": "meta_attribution_app__ping_datetime"
+      }
+    ],
+    "name": "metadata",
+    "type": "RECORD"
+  },
+  {
+    "type": "STRING",
+    "name": "adjust_network"
+  },
+  {
+    "type": "STRING",
+    "name": "install_source"
+  },
+  {
+    "type": "INTEGER",
+    "name": "campaign_id"
+  },
+  {
+    "type": "INTEGER",
+    "name": "ad_group_id"
+  }
+]
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.schema.json /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.schema.json
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.schema.json	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.schema.json	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,34 @@
+[
+  {
+    "type": "DATE",
+    "name": "submission_date"
+  },
+  {
+    "type": "STRING",
+    "name": "client_id"
+  },
+  {
+    "type": "INTEGER",
+    "name": "sample_id"
+  },
+  {
+    "type": "STRING",
+    "name": "normalized_channel"
+  },
+  {
+    "type": "INTEGER",
+    "name": "n_metrics_ping"
+  },
+  {
+    "type": "INTEGER",
+    "name": "days_sent_metrics_ping_bits"
+  },
+  {
+    "type": "INTEGER",
+    "name": "uri_count"
+  },
+  {
+    "type": "BOOLEAN",
+    "name": "is_default_browser"
+  }
+]
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/expect.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/expect.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/expect.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/expect.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,13 @@
+---
+- submission_date: 2020-01-05
+  app_name: Fenix
+  attributed: False
+  country: ??
+  os_version_major: 0
+  os_version_minor: 0
+  daily_users: 3
+  weekly_users: 3
+  monthly_users: 0
+  dau: 3
+  wau: 1
+  mau: 0
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.active_users.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.active_users.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.active_users.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.active_users.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,25 @@
+# combinations for active users status should return the correct dau, wau, mau.
+- submission_date: 2020-01-05
+  app_name: Fenix
+  is_daily_user: True
+  is_weekly_user: True
+  is_monthly_user: False
+  is_dau: True
+  is_wau: False
+  is_mau: False
+- submission_date: 2020-01-05
+  app_name: Fenix
+  is_daily_user: True
+  is_weekly_user: True
+  is_monthly_user: False
+  is_dau: True
+  is_wau: False
+  is_mau: False
+- submission_date: 2020-01-05
+  app_name: Fenix
+  is_daily_user: True
+  is_weekly_user: True
+  is_monthly_user: False
+  is_dau: True
+  is_wau: True
+  is_mau: False
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- first_seen_date: 2020-01-05
+  client_id: client-1
+- first_seen_date: 2020-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- submission_date: 2020-01-05
+  client_id: client-1
+- submission_date: 2020-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/query_params.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/query_params.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/query_params.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_active_users_combinations/query_params.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,4 @@
+---
+- name: submission_date
+  type: DATE
+  value: 2020-01-05
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/expect.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/expect.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/expect.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/expect.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,29 @@
+---
+- submission_date: 2020-01-05
+  app_name: Fenix
+  attributed: False
+  segment: segment-3
+  city: ??
+  country: ??
+  os_version_major: 0
+  os_version_minor: 0
+  daily_users: 0
+  weekly_users: 0
+  monthly_users: 0
+  dau: 0
+  wau: 1
+  mau: 1
+- submission_date: 2020-01-05
+  app_name: Fenix
+  attributed: False
+  city: city-4
+  country: ??
+  segment: segment-4
+  os_version_major: 0
+  os_version_minor: 0
+  daily_users: 0
+  weekly_users: 0
+  monthly_users: 1
+  dau: 0
+  wau: 0
+  mau: 1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.active_users.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.active_users.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.active_users.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.active_users.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,21 @@
+# city NULL should result in ??. activity_segment calculation remains stable.
+- submission_date: 2020-01-05
+  app_name: Fenix
+  client_id: client-3
+  sample_id: 3
+  city: ??
+  activity_segment: segment-3
+  is_dau: False
+  is_wau: True
+  is_mau: True
+# city not NULL and activity_segment calculation remain stable.
+- submission_date: 2020-01-05
+  app_name: Fenix
+  client_id: client-4
+  sample_id: 3
+  city: city-4
+  activity_segment: segment-4
+  is_monthly_user: True
+  is_dau: False
+  is_wau: False
+  is_mau: True
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- first_seen_date: 2010-01-05
+  client_id: client-1
+- first_seen_date: 2010-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- submission_date: 2020-01-05
+  client_id: client-1
+- submission_date: 2020-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/query_params.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/query_params.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/query_params.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_city_and_activity_segment/query_params.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,4 @@
+---
+- name: submission_date
+  type: DATE
+  value: 2020-01-05
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/expect.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/expect.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/expect.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/expect.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,27 @@
+---
+- submission_date: 2020-01-01
+  app_name: Fenix
+  attributed: False
+  first_seen_year: 2000
+  country: ??
+  os_version_major: 0
+  os_version_minor: 0
+  daily_users: 0
+  weekly_users: 0
+  monthly_users: 0
+  dau: 0
+  wau: 0
+  mau: 0
+- submission_date: 2020-01-01
+  app_name: Fenix
+  attributed: False
+  first_seen_year: 2010
+  country: CO
+  os_version_major: 0
+  os_version_minor: 0
+  daily_users: 0
+  weekly_users: 0
+  monthly_users: 0
+  dau: 1
+  wau: 1
+  mau: 1
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.active_users.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.active_users.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.active_users.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.active_users.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,19 @@
+# country null should result in ??. first_seen_year_new calculated correctly.
+- submission_date: 2020-01-01
+  app_name: Fenix
+  client_id: client-1
+  sample_id: 0
+  first_seen_date: 2000-01-01
+  is_dau: False
+  is_wau: False
+  is_mau: False
+# country not null. first_seen_year_new calculated correctly.
+- submission_date: 2020-01-01
+  app_name: Fenix
+  client_id: client-2
+  sample_id: 2
+  country: CO
+  first_seen_date: 2010-11-01
+  is_dau: True
+  is_wau: True
+  is_mau: True
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- first_seen_date: 2010-01-05
+  client_id: client-1
+- first_seen_date: 2010-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- submission_date: 2020-01-05
+  client_id: client-1
+- submission_date: 2020-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/query_params.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/query_params.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/query_params.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_country_and_first_seen_year/query_params.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,4 @@
+---
+- name: submission_date
+  type: DATE
+  value: 2020-01-01
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/expect.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/expect.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/expect.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/expect.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,26 @@
+---
+- submission_date: 2020-01-03
+  app_name: Fenix
+  attributed: False
+  country: ??
+  os_version: '10.0'
+  os_version_major: 10
+  os_version_minor: 0
+  daily_users: 0
+  weekly_users: 0
+  monthly_users: 0
+  dau: 0
+  wau: 0
+  mau: 0
+- submission_date: 2020-01-03
+  app_name: Fenix
+  attributed: False
+  country: ??
+  os_version_major: 0
+  os_version_minor: 0
+  daily_users: 1
+  weekly_users: 1
+  monthly_users: 1
+  dau: 0
+  wau: 0
+  mau: 0
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.active_users.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.active_users.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.active_users.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.active_users.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,20 @@
+# os_version unaffected by Windows build number as it only applies to Fx Desktop.
+- submission_date: 2020-01-03
+  app_name: Fenix
+  client_id: client-5
+  sample_id: 5
+  os: Windows_NT
+  normalized_os_version: 10.0
+  windows_build_number: 26100
+  is_daily_user: False
+  is_weekly_user: False
+  is_monthly_user: False
+# os_version stable for Linux / Mobile.
+- submission_date: 2020-01-03
+  app_name: Fenix
+  client_id: client-6
+  sample_id: 6
+  os: Linux
+  is_daily_user: True
+  is_weekly_user: True
+  is_monthly_user: True
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- first_seen_date: 2010-01-05
+  client_id: client-1
+- first_seen_date: 2010-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- submission_date: 2020-01-05
+  client_id: client-1
+- submission_date: 2020-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/query_params.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/query_params.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/query_params.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_build/query_params.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,4 @@
+---
+- name: submission_date
+  type: DATE
+  value: 2020-01-03
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/expect.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/expect.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/expect.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/expect.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,27 @@
+---
+- submission_date: 2020-01-04
+  attributed: False
+  app_name: Fenix
+  country: ??
+  os_version_major: 10
+  os_version_minor: 3
+  os_version: '10.3.10'
+  daily_users: 0
+  weekly_users: 1
+  monthly_users: 1
+  dau: 0
+  wau: 0
+  mau: 0
+- submission_date: 2020-01-04
+  app_name: Fenix
+  attributed: False
+  country: ??
+  os_version: '11'
+  os_version_minor: 0
+  os_version_major: 11
+  daily_users: 0
+  weekly_users: 0
+  monthly_users: 1
+  dau: 0
+  wau: 0
+  mau: 0
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.active_users.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.active_users.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.active_users.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.active_users.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,20 @@
+# os_version_major & os_version_minor remain stable.
+- submission_date: 2020-01-04
+  app_name: Fenix
+  client_id: client-7
+  sample_id: 7
+  os: os-7
+  normalized_os_version: 10.3.10
+  is_daily_user: False
+  is_weekly_user: True
+  is_monthly_user: True
+# os_version without major nor minor.
+- submission_date: 2020-01-04
+  app_name: Fenix
+  client_id: client-8
+  sample_id: 8
+  os: os-8
+  normalized_os_version: 11
+  is_daily_user: False
+  is_weekly_user: False
+  is_monthly_user: True
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.firefox_android_clients.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,7 @@
+# additional combinations for active users
+- first_seen_date: 2010-01-05
+  client_id: client-1
+- first_seen_date: 2010-01-05
+  client_id: client-2
+  adjust_network: adjust-2
+  install_source: install-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/moz-fx-data-shared-prod.fenix.metrics_clients_last_seen.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,5 @@
+# additional combinations for active users
+- submission_date: 2020-01-05
+  client_id: client-1
+- submission_date: 2020-01-05
+  client_id: client-2
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/query_params.yaml /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/query_params.yaml
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/query_params.yaml	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/fenix_derived/active_users_aggregates_v3/test_os_version_major_minor/query_params.yaml	2026-01-06 00:00:32.000000000 +0000
@@ -0,0 +1,4 @@
+---
+- name: submission_date
+  type: DATE
+  value: 2020-01-04
diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4/moz-fx-data-shared-prod.telemetry.desktop_active_users.schema.json /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4/moz-fx-data-shared-prod.telemetry.desktop_active_users.schema.json
--- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4/moz-fx-data-shared-prod.telemetry.desktop_active_users.schema.json	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/firefox_desktop_derived/active_users_aggregates_v4/moz-fx-data-shared-prod.telemetry.desktop_active_users.schema.json	2026-01-06 00:

⚠️ Only part of the diff is displayed.

Link to full diff

@kbammarito kbammarito marked this pull request as ready for review January 6, 2026 01:40
Comment on lines +633 to +634
- sql/moz-fx-data-shared-prod/org_mozilla_firefox_derived/events_first_seen_v1
- sql/moz-fx-data-shared-prod/org_mozilla_ios_firefox_derived/events_first_seen_v1
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (blocking): These two ETLs you're adding to the retention_exclusion_list config here are for the release channels of Firefox Android and Firefox iOS, but there are additional ETLs for their other channels which should presumably also be added here.

sql: event_category = 'tabgroup' AND ((event_name = 'smart_tab_suggest' AND JSON_VALUE(event_extra.action) LIKE 'save%') OR (event_name = 'smart_tab_topic' AND JSON_VALUE(event_extra.action) = 'save'))
- name: "'linkpreview_ai_consent'"
sql: event_category = 'genai.linkpreview' AND event_name = 'card_ai_consent' AND JSON_VALUE(event_extra.option) = 'continue'
any_event: |
Copy link
Contributor

Choose a reason for hiding this comment

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

note: Changing this criteria name value from null to any_event at this point means you'll need to manually update existing firefox_desktop_derived.events_first_seen_v1 records that currently have null criteria values when this is deployed to avoid getting extraneous any_event records for existing clients when that ETL runs with this new logic.

depends_on_past: true
date_partition_parameter: null

bigquery:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (non-blocking): I'd recommend adding criteria as the primary clustering field, removing normalized_country_code as a clustering field (since you can only have four clustering columns), and maybe moving event_category to be the last clustering field.

Comment on lines +49 to +53
AND event_category NOT IN (
'media.playback',
'nimbus_events',
'uptake.remotecontent.result'
) -- remove unnecessary high-volume categories to reduce cost
Copy link
Contributor

Choose a reason for hiding this comment

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

quibble: Having the trailing comment was reasonable when this was all on one line, but when the expression is formatted as multiple lines IMO the trailing comment is less readable.

Suggested change
AND event_category NOT IN (
'media.playback',
'nimbus_events',
'uptake.remotecontent.result'
) -- remove unnecessary high-volume categories to reduce cost
-- remove unnecessary high-volume categories to reduce cost
AND event_category NOT IN (
'media.playback',
'nimbus_events',
'uptake.remotecontent.result'
)

)
ORDER BY
submission_timestamp,
COALESCE(event_timestamp, '9999-12-31 23:59:59')
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (non-blocking): I added a document_event_number column to events_stream_v1 tables in #8596, which could be used here to break ties if multiple events have the same timestamp.

Suggested change
COALESCE(event_timestamp, '9999-12-31 23:59:59')
COALESCE(event_timestamp, '9999-12-31 23:59:59'),
document_event_number

'uptake.remotecontent.result'
) -- remove unnecessary high-volume categories to reduce cost
{% if app_id_dataset == 'firefox_desktop' -%}
AND profile_group_id IS NOT NULL -- only include non-null IDs so as not to create repeats
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Why would including null profile_group_id values create repeats? The query isn't grouping by profile_group_id, so it doesn't seem like including older event records with null profile_group_id values would cause repeats.

In fact, doesn't excluding older event records with null profile_group_id values mean this isn't returning entirely accurate "events first seen" data for Firefox Desktop? It's more like "events first seen since the profile group ID was set".

,
_previous_cte AS (
SELECT
first_submission_timestamp,
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (non-blocking): These _previous_cte queries don't need to select all the data fields anymore since they're only being used for comparison purposes. I think they only need to select client_id, event, and criteria.

AND _current.event = _previous.event
AND (_current.criteria = _previous.criteria
OR (_current.criteria IS NULL AND _previous.criteria IS NULL))
AND criteria IS NOT DISTINCT FROM {{ ("'" ~ criteria_name ~ "'") }}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (non-blocking): Now that criteria won't have null values, this could be written more naturally using !=:

Suggested change
AND criteria IS NOT DISTINCT FROM {{ ("'" ~ criteria_name ~ "'") }}
AND criteria != {{ "'" ~ criteria_name ~ "'" }}

However, I actually think it would instead be better overall to move the UNION ALL criteria loop into the events_stream_cte CTE and have a single not-criteria-specific _previous_cte CTE and final query that selects from events_stream_cte where there isn't a matching _previous_cte record (rather than repeating that code for each criteria).

# - firefox_ios
# - fenix
- fenix
- firefox_ios
Copy link
Contributor

Choose a reason for hiding this comment

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

question: How long do you estimate the init process for these new events_first_seen_v1 ETL tables will take?

Comment on lines +35 to +48
WHERE
{% raw %}
{% if is_init() %}
{% endraw %}
DATE(submission_timestamp) >= '2023-01-01' -- initialize by looking over all of history
AND sample_id >= @sample_id
AND sample_id < @sample_id + @sampling_batch_size
{% raw %}
{% else %}
{% endraw %}
DATE(submission_timestamp) = @submission_date
{% raw %}
{% endif %}
{% endraw %}
Copy link
Contributor

Choose a reason for hiding this comment

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

quibble: I think this would make it easier to see the structure of the Jinja code being generated:

Suggested change
WHERE
{% raw %}
{% if is_init() %}
{% endraw %}
DATE(submission_timestamp) >= '2023-01-01' -- initialize by looking over all of history
AND sample_id >= @sample_id
AND sample_id < @sample_id + @sampling_batch_size
{% raw %}
{% else %}
{% endraw %}
DATE(submission_timestamp) = @submission_date
{% raw %}
{% endif %}
{% endraw %}
WHERE
{% raw %}{% if is_init() %}{% endraw %}
DATE(submission_timestamp) >= '2023-01-01' -- initialize by looking over all of history
AND sample_id >= @sample_id
AND sample_id < @sample_id + @sampling_batch_size
{% raw %}{% else %}{% endraw %}
DATE(submission_timestamp) = @submission_date
{% raw %}{% endif %}{% endraw %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants