Bug 1770814 adm_daily_aggregates (#2999)

* Bug 1770814 adm_daily_aggregates

See https://bugzilla.mozilla.org/show_bug.cgi?id=1770814

* Remove filter on aggregated_search_Terms_daily_v1
This commit is contained in:
Jeff Klukas 2022-06-01 16:15:34 -04:00 коммит произвёл GitHub
Родитель 2b7d6ddeca
Коммит c7049d8d52
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 73 добавлений и 2 удалений

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

@ -53,6 +53,22 @@ with DAG(
tags=tags,
) as dag:
search_terms_derived__adm_daily_aggregates__v1 = bigquery_etl_query(
task_id="search_terms_derived__adm_daily_aggregates__v1",
destination_table="adm_daily_aggregates_v1",
dataset_id="search_terms_derived",
project_id="moz-fx-data-shared-prod",
owner="jklukas@mozilla.com",
email=[
"jklukas@mozilla.com",
"rburwei@mozilla.com",
"telemetry-alerts@mozilla.com",
],
date_partition_parameter="submission_date",
depends_on_past=False,
arguments=["--schema_update_option=ALLOW_FIELD_ADDITION"],
)
search_terms_derived__adm_weekly_aggregates__v1 = bigquery_etl_query(
task_id="search_terms_derived__adm_weekly_aggregates__v1",
destination_table="adm_weekly_aggregates_v1",
@ -116,6 +132,10 @@ with DAG(
arguments=["--schema_update_option=ALLOW_FIELD_ADDITION"],
)
search_terms_derived__adm_daily_aggregates__v1.set_upstream(
search_terms_derived__suggest_impression_sanitized__v2
)
search_terms_derived__adm_weekly_aggregates__v1.set_upstream(
search_terms_derived__suggest_impression_sanitized__v2
)

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

@ -0,0 +1,21 @@
---
friendly_name: adMarketplace Daily Aggregates
description: |-
Daily summary for adMarketplace of Firefox Suggest impressions and clicks
per search term
The sending to adMarketplace takes place in a separate DAG defined in
the telemetry-airflow repository directly.
owners:
- jklukas@mozilla.com
workgroup_access:
- role: roles/bigquery.dataViewer
members:
- workgroup:search-terms/aggregated
bigquery:
time_partitioning:
field: submission_date
type: day
scheduling:
dag_name: bqetl_search_terms_daily
arguments: ['--schema_update_option=ALLOW_FIELD_ADDITION']

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

@ -0,0 +1,15 @@
SELECT
@submission_date AS submission_date,
sanitized_query AS query,
block_id,
COUNT(*) AS impressions,
COUNTIF(is_clicked) AS clicks,
FROM
search_terms_derived.suggest_impression_sanitized_v2
WHERE
DATE(submission_timestamp) = @submission_date
AND LENGTH(sanitized_query) > 0
AND normalized_channel = 'release'
GROUP BY
query,
block_id

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

@ -0,0 +1,17 @@
fields:
- mode: NULLABLE
name: submission_date
type: DATE
description: Date of the tile ID export
- mode: NULLABLE
name: query
type: STRING
- mode: NULLABLE
name: block_id
type: INTEGER
- mode: NULLABLE
name: impressions
type: INTEGER
- mode: NULLABLE
name: clicks
type: INTEGER

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

@ -11,5 +11,3 @@ WHERE
GROUP BY
submission_date,
search_terms
HAVING
client_days > 30000