mozilla / bigquery-etl

Bigquery ETL
https://mozilla.github.io/bigquery-etl
Mozilla Public License 2.0
253 stars 100 forks source link

adding search_with_ads_organic to mobile_clients_daily table #5683

Closed pissac17 closed 4 months ago

pissac17 commented 4 months ago

Checklist for reviewer:

For modifications to schemas in restricted namespaces (see CODEOWNERS):

┆Issue is synchronized with this Jira Task

dataops-ci-bot commented 4 months ago

Integration report for "adding search_with_ads_organic to mobile_clients_daily table"

sql.diff

Click to expand! ```diff diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql --- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql 2024-05-30 15:45:47.000000000 +0000 +++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql 2024-05-30 15:45:40.000000000 +0000 @@ -722,6 +722,12 @@ SUBSTR(search.key, STRPOS(search.key, '.') + 1), search.search_type ) + WHEN search.search_type = 'search-with-ads' + THEN IF( + REGEXP_CONTAINS(search.key, '\\.'), + SUBSTR(search.key, STRPOS(search.key, '.') + 1), + search.search_type + ) ELSE search.search_type END AS source, search.value AS search_count, @@ -774,6 +780,8 @@ CASE WHEN search_type = 'ad-click' THEN IF(STARTS_WITH(source, 'in-content.organic'), 'ad-click-organic', search_type) + WHEN search_type = 'search-with-ads' + THEN IF(STARTS_WITH(source, 'in-content.organic'), 'search-with-ads-organic', search_type) WHEN STARTS_WITH(source, 'in-content.sap.') THEN 'tagged-sap' WHEN REGEXP_CONTAINS(source, '^in-content.*-follow-on') @@ -856,6 +864,15 @@ ) ) AS search_with_ads, SUM( + IF( + search_type != 'search-with-ads-organic' + OR engine IS NULL + OR search_count > 10000, + 0, + search_count + ) + ) AS search_with_ads_organic, + SUM( IF(search_type != 'unknown' OR engine IS NULL OR search_count > 10000, 0, search_count) ) AS unknown, udf.mode_last(ARRAY_AGG(country)) AS country, ```

Link to full diff

dataops-ci-bot commented 4 months ago

Integration report for "Fix the CI tests"

sql.diff

Click to expand! ```diff diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql --- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql 2024-05-30 16:12:55.000000000 +0000 +++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql 2024-05-30 16:13:06.000000000 +0000 @@ -722,6 +722,12 @@ SUBSTR(search.key, STRPOS(search.key, '.') + 1), search.search_type ) + WHEN search.search_type = 'search-with-ads' + THEN IF( + REGEXP_CONTAINS(search.key, '\\.'), + SUBSTR(search.key, STRPOS(search.key, '.') + 1), + search.search_type + ) ELSE search.search_type END AS source, search.value AS search_count, @@ -774,6 +780,8 @@ CASE WHEN search_type = 'ad-click' THEN IF(STARTS_WITH(source, 'in-content.organic'), 'ad-click-organic', search_type) + WHEN search_type = 'search-with-ads' + THEN IF(STARTS_WITH(source, 'in-content.organic'), 'search-with-ads-organic', search_type) WHEN STARTS_WITH(source, 'in-content.sap.') THEN 'tagged-sap' WHEN REGEXP_CONTAINS(source, '^in-content.*-follow-on') @@ -856,6 +864,15 @@ ) ) AS search_with_ads, SUM( + IF( + search_type != 'search-with-ads-organic' + OR engine IS NULL + OR search_count > 10000, + 0, + search_count + ) + ) AS search_with_ads_organic, + SUM( IF(search_type != 'unknown' OR engine IS NULL OR search_count > 10000, 0, search_count) ) AS unknown, udf.mode_last(ARRAY_AGG(country)) AS country, ```

Link to full diff

dataops-ci-bot commented 4 months ago

Integration report for "Merge branch 'main' into RS_788_clients_daily_table"

sql.diff

Click to expand! ```diff diff -bur --no-dereference --new-file /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql --- /tmp/workspace/main-generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql 2024-05-30 18:01:06.000000000 +0000 +++ /tmp/workspace/generated-sql/sql/moz-fx-data-shared-prod/search_derived/mobile_search_clients_daily_v1/query.sql 2024-05-30 18:01:05.000000000 +0000 @@ -722,6 +722,12 @@ SUBSTR(search.key, STRPOS(search.key, '.') + 1), search.search_type ) + WHEN search.search_type = 'search-with-ads' + THEN IF( + REGEXP_CONTAINS(search.key, '\\.'), + SUBSTR(search.key, STRPOS(search.key, '.') + 1), + search.search_type + ) ELSE search.search_type END AS source, search.value AS search_count, @@ -774,6 +780,8 @@ CASE WHEN search_type = 'ad-click' THEN IF(STARTS_WITH(source, 'in-content.organic'), 'ad-click-organic', search_type) + WHEN search_type = 'search-with-ads' + THEN IF(STARTS_WITH(source, 'in-content.organic'), 'search-with-ads-organic', search_type) WHEN STARTS_WITH(source, 'in-content.sap.') THEN 'tagged-sap' WHEN REGEXP_CONTAINS(source, '^in-content.*-follow-on') @@ -856,6 +864,15 @@ ) ) AS search_with_ads, SUM( + IF( + search_type != 'search-with-ads-organic' + OR engine IS NULL + OR search_count > 10000, + 0, + search_count + ) + ) AS search_with_ads_organic, + SUM( IF(search_type != 'unknown' OR engine IS NULL OR search_count > 10000, 0, search_count) ) AS unknown, udf.mode_last(ARRAY_AGG(country)) AS country, ```

Link to full diff