DENG-4677 Add profile_group_id to search_clients_last_seen_v1 (#6139)

This commit is contained in:
Katie Windau 2024-08-30 12:06:16 -05:00 коммит произвёл GitHub
Родитель e7f3a76d38
Коммит dfab201473
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -84,7 +84,8 @@ _grouped AS (
-- Monthly search totals
`moz-fx-data-shared-prod.udf.aggregate_search_map`(
ARRAY_AGG(engine_searches)
) AS engine_searches
) AS engine_searches,
`moz-fx-data-shared-prod.udf.mode_last`(ARRAY_AGG(profile_group_id)) AS profile_group_id,
FROM
_derived_engine_searches
GROUP BY
@ -93,7 +94,7 @@ _grouped AS (
),
_current AS (
SELECT
*,
* EXCEPT (profile_group_id),
-- In this raw table, we capture the history of activity over the past
-- 365 days for each usage criterion as an array of bytes. The
-- rightmost bit represents whether the user was active in the current day.
@ -110,7 +111,8 @@ _current AS (
`moz-fx-data-shared-prod.udf.days_since_created_profile_as_28_bits`(
DATE_DIFF(@submission_date, SAFE.DATE_FROM_UNIX_DATE(profile_creation_date), DAY)
)
) AS days_created_profile_bytes
) AS days_created_profile_bytes,
profile_group_id
FROM
_grouped
),

Просмотреть файл

@ -139,3 +139,6 @@ fields:
- mode: NULLABLE
name: days_created_profile_bytes
type: BYTES
- mode: NULLABLE
name: profile_group_id
type: STRING

Просмотреть файл

@ -35,5 +35,6 @@
{"type":"STRING","name":"user_pref_browser_search_region","mode":"NULLABLE"},
{"type":"INTEGER","name":"search_with_ads_1","mode":"NULLABLE"},
{"type":"INTEGER","name":"ad_click_1","mode":"NULLABLE"},
{"type":"STRING","name":"os_version","mode":"NULLABLE"}
{"type":"STRING","name":"os_version","mode":"NULLABLE"},
{"type":"STRING","name":"profile_group_id","mode":"NULLABLE"}
]

Просмотреть файл

@ -1 +1 @@
[{"type":"DATE","name":"submission_date"},{"type":"STRING","name":"client_id"},{"type":"INTEGER","name":"sample_id"},{"type":"STRING","name":"country"},{"type":"STRING","name":"app_version"},{"type":"STRING","name":"distribution_id"},{"type":"STRING","name":"locale"},{"type":"STRING","name":"search_cohort"},{"type":"STRING","name":"addon_version"},{"type":"STRING","name":"os"},{"type":"STRING","name":"channel"},{"type":"INTEGER","name":"profile_creation_date"},{"type":"STRING","name":"default_search_engine"},{"type":"STRING","name":"default_search_engine_data_load_path"},{"type":"STRING","name":"default_search_engine_data_submission_url"},{"type":"INTEGER","name":"profile_age_in_days"},{"type":"FLOAT","name":"active_addons_count_mean"},{"type":"STRING","name":"user_pref_browser_search_region"},{"type":"STRING","name":"os_version"},{"type":"INTEGER","name":"max_concurrent_tab_count_max"},{"type":"INTEGER","name":"tab_open_event_count_sum"},{"type":"FLOAT","name":"active_hours_sum"},{"type":"FLOAT","name":"subsession_hours_sum"},{"type":"INTEGER","name":"sessions_started_on_this_day"},{"type":"INTEGER","name":"organic"},{"type":"INTEGER","name":"sap"},{"type":"INTEGER","name":"unknown"},{"type":"INTEGER","name":"tagged_sap"},{"type":"INTEGER","name":"tagged_follow_on"},{"type":"INTEGER","name":"ad_click"},{"type":"INTEGER","name":"search_with_ads"},{"type":"INTEGER","name":"total_searches"},{"type":"INTEGER","name":"tagged_searches"},{"fields":[{"type":"STRING","name":"key"},{"fields":[{"type":"INTEGER","name":"total_searches","mode":"REPEATED"},{"type":"INTEGER","name":"tagged_searches","mode":"REPEATED"},{"type":"INTEGER","name":"search_with_ads","mode":"REPEATED"},{"type":"INTEGER","name":"ad_click","mode":"REPEATED"}],"type":"RECORD","name":"value"}],"type":"RECORD","name":"engine_searches","mode":"REPEATED"},{"type":"BYTES","name":"days_seen_bytes"},{"type":"BYTES","name":"days_searched_bytes"},{"type":"BYTES","name":"days_tagged_searched_bytes"},{"type":"BYTES","name":"days_searched_with_ads_bytes"},{"type":"BYTES","name":"days_clicked_ads_bytes"},{"type":"BYTES","name":"days_created_profile_bytes"}]
[{"type":"DATE","name":"submission_date"},{"type":"STRING","name":"client_id"},{"type":"INTEGER","name":"sample_id"},{"type":"STRING","name":"country"},{"type":"STRING","name":"app_version"},{"type":"STRING","name":"distribution_id"},{"type":"STRING","name":"locale"},{"type":"STRING","name":"search_cohort"},{"type":"STRING","name":"addon_version"},{"type":"STRING","name":"os"},{"type":"STRING","name":"channel"},{"type":"INTEGER","name":"profile_creation_date"},{"type":"STRING","name":"default_search_engine"},{"type":"STRING","name":"default_search_engine_data_load_path"},{"type":"STRING","name":"default_search_engine_data_submission_url"},{"type":"INTEGER","name":"profile_age_in_days"},{"type":"FLOAT","name":"active_addons_count_mean"},{"type":"STRING","name":"user_pref_browser_search_region"},{"type":"STRING","name":"os_version"},{"type":"INTEGER","name":"max_concurrent_tab_count_max"},{"type":"INTEGER","name":"tab_open_event_count_sum"},{"type":"FLOAT","name":"active_hours_sum"},{"type":"FLOAT","name":"subsession_hours_sum"},{"type":"INTEGER","name":"sessions_started_on_this_day"},{"type":"INTEGER","name":"organic"},{"type":"INTEGER","name":"sap"},{"type":"INTEGER","name":"unknown"},{"type":"INTEGER","name":"tagged_sap"},{"type":"INTEGER","name":"tagged_follow_on"},{"type":"INTEGER","name":"ad_click"},{"type":"INTEGER","name":"search_with_ads"},{"type":"INTEGER","name":"total_searches"},{"type":"INTEGER","name":"tagged_searches"},{"fields":[{"type":"STRING","name":"key"},{"fields":[{"type":"INTEGER","name":"total_searches","mode":"REPEATED"},{"type":"INTEGER","name":"tagged_searches","mode":"REPEATED"},{"type":"INTEGER","name":"search_with_ads","mode":"REPEATED"},{"type":"INTEGER","name":"ad_click","mode":"REPEATED"}],"type":"RECORD","name":"value"}],"type":"RECORD","name":"engine_searches","mode":"REPEATED"},{"type":"BYTES","name":"days_seen_bytes"},{"type":"BYTES","name":"days_searched_bytes"},{"type":"BYTES","name":"days_tagged_searched_bytes"},{"type":"BYTES","name":"days_searched_with_ads_bytes"},{"type":"BYTES","name":"days_clicked_ads_bytes"},{"type":"BYTES","name":"days_created_profile_bytes"},{"type":"STRING","name":"profile_group_id"}]