From 4f835913a7cea3e3195fe2ac45462e882d982b08 Mon Sep 17 00:00:00 2001 From: Jeff Klukas Date: Wed, 19 May 2021 16:28:56 -0400 Subject: [PATCH] DO-500 Rename search_clients_daily See https://jira.mozilla.com/projects/DO/issues/DO-500 `search_clients_daily` becomes `search_clients_engines_sources_daily` which more accurately represents the data model. We also rename the mobile equivalent and the related `last_seen` views. The old views stick around for now. We will need to announce deprecation of the old views and a timeline for turning them off. The underlying tables are unchanged. This effort is only about changing the user interface. --- .../metadata.yaml | 8 +++++++ .../view.sql | 9 ++++++++ .../metadata.yaml | 7 +++++++ .../view.sql | 8 +++++++ .../metadata.yaml | 6 ++++++ .../view.sql | 9 ++++++++ .../metadata.yaml | 7 +++++++ .../view.sql | 21 +++++++++++++++++++ .../metadata.yaml | 7 +++++-- .../metadata.yaml | 8 ++++--- .../search_clients_daily_v8/metadata.yaml | 5 ++++- .../search_clients_last_seen_v1/metadata.yaml | 8 ++++--- 12 files changed, 94 insertions(+), 9 deletions(-) create mode 100644 sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/metadata.yaml create mode 100755 sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/view.sql create mode 100644 sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/metadata.yaml create mode 100644 sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/view.sql create mode 100644 sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/metadata.yaml create mode 100755 sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/view.sql create mode 100644 sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/metadata.yaml create mode 100644 sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/view.sql diff --git a/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/metadata.yaml b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/metadata.yaml new file mode 100644 index 0000000000..c602314725 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/metadata.yaml @@ -0,0 +1,8 @@ +--- +friendly_name: Mobile Search Clients Engines Sources Daily +description: | + A daily aggregate of baseline and metrics pings that have + searches from each (client_id, engine, source) combination, + partitioned by day. +owners: + - bewu@mozilla.com diff --git a/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/view.sql b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/view.sql new file mode 100755 index 0000000000..b94886ced0 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_daily/view.sql @@ -0,0 +1,9 @@ +CREATE OR REPLACE VIEW + `moz-fx-data-shared-prod.search.mobile_search_clients_engines_sources_daily` +AS +SELECT + * EXCEPT (normalized_engine), + `moz-fx-data-shared-prod`.udf.normalize_search_engine(engine) AS normalized_engine, + search_count AS sap, +FROM + `moz-fx-data-shared-prod.search_derived.mobile_search_clients_daily_v1` diff --git a/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/metadata.yaml b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/metadata.yaml new file mode 100644 index 0000000000..8462581b68 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/metadata.yaml @@ -0,0 +1,7 @@ +--- +friendly_name: Mobile Search Clients Engines Sources Last Seen +description: | + Captures search activity of each (client_id, engine, source) combination + for mobile clients in the past 365 days for each submission date. +owners: + - bewu@mozilla.com diff --git a/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/view.sql b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/view.sql new file mode 100644 index 0000000000..15936b520e --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/mobile_search_clients_engines_sources_last_seen/view.sql @@ -0,0 +1,8 @@ +CREATE OR REPLACE VIEW + `moz-fx-data-shared-prod.search.mobile_search_clients_engines_sources_last_seen` +AS +SELECT + * EXCEPT (engine_searches, total_searches), + `moz-fx-data-shared-prod`.udf.normalize_monthly_searches(engine_searches) AS engine_searches, +FROM + `moz-fx-data-shared-prod.search_derived.mobile_search_clients_last_seen_v1` diff --git a/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/metadata.yaml b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/metadata.yaml new file mode 100644 index 0000000000..9e07472cd1 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/metadata.yaml @@ -0,0 +1,6 @@ +--- +friendly_name: Search Clients Engines Sources Daily +description: | + A daily aggregate of desktop searches per (client_id, engine, source). +owners: + - bewu@mozilla.com diff --git a/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/view.sql b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/view.sql new file mode 100755 index 0000000000..18587679a5 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_daily/view.sql @@ -0,0 +1,9 @@ +CREATE OR REPLACE VIEW + `moz-fx-data-shared-prod.search.search_clients_engines_sources_daily` +AS +SELECT + submission_date AS submission_date_s3, + * EXCEPT (normalized_engine), + `moz-fx-data-shared-prod`.udf.normalize_search_engine(engine) AS normalized_engine, +FROM + `moz-fx-data-shared-prod.search_derived.search_clients_daily_v8` diff --git a/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/metadata.yaml b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/metadata.yaml new file mode 100644 index 0000000000..9ccf6f1075 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/metadata.yaml @@ -0,0 +1,7 @@ +--- +friendly_name: Search Clients Engines Sources Last Seen +description: | + Captures search history of each desktop (client_id, engine, source) + combination in 28 day windows for each submission date. +owners: + - frank@mozilla.com diff --git a/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/view.sql b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/view.sql new file mode 100644 index 0000000000..ec75bfd4e5 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/search/search_clients_engines_sources_last_seen/view.sql @@ -0,0 +1,21 @@ +CREATE OR REPLACE VIEW + `moz-fx-data-shared-prod.search.search_clients_engines_sources_last_seen` +AS +SELECT + * EXCEPT (total_searches), + `moz-fx-data-shared-prod`.udf.bits_to_days_since_seen(days_seen_bytes) AS days_since_seen, + `moz-fx-data-shared-prod`.udf.bits_to_days_since_seen(days_searched_bytes) AS days_since_searched, + `moz-fx-data-shared-prod`.udf.bits_to_days_since_seen( + days_tagged_searched_bytes + ) AS days_since_tagged_searched, + `moz-fx-data-shared-prod`.udf.bits_to_days_since_seen( + days_searched_with_ads_bytes + ) AS days_since_searched_with_ads, + `moz-fx-data-shared-prod`.udf.bits_to_days_since_seen( + days_clicked_ads_bytes + ) AS days_since_clicked_ad, + `moz-fx-data-shared-prod`.udf.bits_to_days_since_first_seen( + days_created_profile_bytes + ) AS days_since_created_profile +FROM + `moz-fx-data-shared-prod.search_derived.search_clients_last_seen_v1` diff --git a/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/metadata.yaml b/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/metadata.yaml index bf759ac767..4a2245f0a6 100644 --- a/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/metadata.yaml +++ b/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/metadata.yaml @@ -1,8 +1,11 @@ --- friendly_name: Mobile Search Clients Daily -description: > +description: | A daily aggregate of baseline and metrics pings that have - searches from each mobile client, partitioned by day + searches from each (client_id, engine, source) combination, + partitioned by day. + + Exposed to users as `search.mobile_search_clients_engines_sources_daily`. owners: - bewu@mozilla.com labels: diff --git a/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_last_seen_v1/metadata.yaml b/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_last_seen_v1/metadata.yaml index 16ed25ee71..8b2b8b5864 100644 --- a/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_last_seen_v1/metadata.yaml +++ b/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_last_seen_v1/metadata.yaml @@ -1,8 +1,10 @@ --- friendly_name: Mobile Search Clients Last Seen -description: |- - Captures search activity of a single mobile client in the past 365 days - for each submission date. +description: | + Captures search activity of each (client_id, engine, source) combination + for mobile clients in the past 365 days for each submission date. + + Exposed to users as `search.mobile_search_clients_engines_sources_last_seen`. owners: - bewu@mozilla.com labels: diff --git a/sql/moz-fx-data-shared-prod/search_derived/search_clients_daily_v8/metadata.yaml b/sql/moz-fx-data-shared-prod/search_derived/search_clients_daily_v8/metadata.yaml index 26025c0b40..711e736efb 100644 --- a/sql/moz-fx-data-shared-prod/search_derived/search_clients_daily_v8/metadata.yaml +++ b/sql/moz-fx-data-shared-prod/search_derived/search_clients_daily_v8/metadata.yaml @@ -1,6 +1,9 @@ --- friendly_name: Search Clients Daily -description: A daily aggregate of search clients, partitioned by day +description: | + A daily aggregate of desktop searches per (client_id, engine, source). + + Exposed to users as view `search.search_clients_engines_sources_daily`. owners: - bewu@mozilla.com labels: diff --git a/sql/moz-fx-data-shared-prod/search_derived/search_clients_last_seen_v1/metadata.yaml b/sql/moz-fx-data-shared-prod/search_derived/search_clients_last_seen_v1/metadata.yaml index a160bf986e..c633757f48 100644 --- a/sql/moz-fx-data-shared-prod/search_derived/search_clients_last_seen_v1/metadata.yaml +++ b/sql/moz-fx-data-shared-prod/search_derived/search_clients_last_seen_v1/metadata.yaml @@ -1,8 +1,10 @@ --- friendly_name: Search Clients Last Seen -description: |- - Captures history of activity of each search client in 28 day - windows for each submission date. +description: | + Captures search history of each (client_id, engine, source) combination + in 28 day windows for each submission date. + + Exposed to users as view `search.search_clients_engines_sources_last_seen`. owners: - frank@mozilla.com labels: