diff --git a/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/backfill.yaml b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/backfill.yaml new file mode 100644 index 00000000000..31b3e1f5cea --- /dev/null +++ b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/backfill.yaml @@ -0,0 +1,11 @@ +2025-08-25: + start_date: 2025-03-31 + end_date: 2025-07-31 + reason: backfill for request in DS-4333 + watchers: + - isegall@mozilla.com + status: Initiate + shredder_mitigation: false + override_retention_limit: false + override_depends_on_past_end_date: false + ignore_date_partition_offset: false diff --git a/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/metadata.yaml b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/metadata.yaml new file mode 100644 index 00000000000..caf0b318a93 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/metadata.yaml @@ -0,0 +1,34 @@ +friendly_name: Reported Content +description: |- + Reported organic content + + For each report, we collect + submission date + card type + corpus item id + report reason + section + section position + title + topic + url +owners: +- isegall@mozilla.com +labels: + application: newtab + incremental: true + schedule: daily + dag: bqetl_newtab + owner1: isegall + table_type: event_level +scheduling: + dag_name: bqetl_newtab +bigquery: + time_partitioning: + type: day + field: submission_date + require_partition_filter: true + expiration_days: null + range_partitioning: null +references: {} +require_column_descriptions: false diff --git a/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/query.sql b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/query.sql new file mode 100644 index 00000000000..1e014994467 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/query.sql @@ -0,0 +1,24 @@ +WITH events AS ( + SELECT + DATE(submission_timestamp) AS submission_date, + mozfun.map.get_key(event.extra, 'card_type') AS card_type, + mozfun.map.get_key(event.extra, 'corpus_item_id') AS corpus_item_id, + mozfun.map.get_key(event.extra, 'report_reason') AS report_reason, + mozfun.map.get_key(event.extra, 'section') AS section, + mozfun.map.get_key(event.extra, 'section_position') AS section_position, + mozfun.map.get_key(event.extra, 'title') AS title, + mozfun.map.get_key(event.extra, 'topic') AS topic, + mozfun.map.get_key(event.extra, 'url') AS url + FROM + `moz-fx-data-shared-prod.firefox_desktop.newtab` AS e + CROSS JOIN + UNNEST(e.events) AS event + WHERE + DATE(submission_timestamp) = @submission_date + AND event.category = 'newtab' + AND event.name = 'report_content_submit' +) +SELECT + * +FROM + events diff --git a/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/schema.yaml b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/schema.yaml new file mode 100644 index 00000000000..00eb856a6d9 --- /dev/null +++ b/sql/moz-fx-data-shared-prod/firefox_desktop_derived/report_content_v1/schema.yaml @@ -0,0 +1,37 @@ +fields: +- name: submission_date + type: DATE + mode: NULLABLE + description: Day the event was received in the newtab content ping +- name: card_type + type: STRING + mode: NULLABLE + description: The type of the content card (e.g., "spoc", "organic") +- name: corpus_item_id + type: STRING + mode: NULLABLE + description: content identifier +- name: section + type: STRING + mode: NULLABLE + description: If click belongs in a section, the name of the section +- name: section_position + type: STRING + mode: NULLABLE + description: If click belongs in a section, the numeric position of the section +- name: report_reason + type: STRING + mode: NULLABLE + description: The reason selected by the user when reporting the content +- name: title + type: STRING + mode: NULLABLE + description: Title of the recommendation. +- name: topic + type: STRING + mode: NULLABLE + description: The topic of the recommendation. Like "entertainment". +- name: url + type: STRING + description: URL of the recommendation. + mode: NULLABLE