Add views for search_clients_last_seen (#926)

* Add views for search_clients_last_seen

* Ignore failed search dryrun
This commit is contained in:
Frank Bertsch 2020-04-22 15:22:25 -04:00 коммит произвёл GitHub
Родитель 568d0a2b6c
Коммит 0543762c5f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 30 добавлений и 0 удалений

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

@ -43,6 +43,8 @@ SKIP = {
"sql/search_derived/search_clients_last_seen_v1/init.sql",
"sql/search_derived/search_clients_last_seen_v1/query.sql",
"sql/search/search_rfm/view.sql",
"sql/search/search_clients_last_seen_v1/view.sql",
"sql/search/search_clients_last_seen/view.sql",
"sql/telemetry_derived/deviations_v1/query.sql",
# Already exists (and lacks an "OR REPLACE" clause)
"sql/org_mozilla_firefox_derived/clients_first_seen_v1/init.sql",

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

@ -0,0 +1,7 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.search.search_clients_last_seen`
AS
SELECT
*
FROM
`moz-fx-data-shared-prod.search.search_clients_last_seen_v1`

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

@ -0,0 +1,21 @@
CREATE OR REPLACE VIEW
`moz-fx-data-shared-prod.search.search_clients_last_seen_v1`
AS
SELECT
`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_ad_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`