From 4dae85094dea521bc39b00b929b6a3cb70c74711 Mon Sep 17 00:00:00 2001 From: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:45:24 +0100 Subject: [PATCH] added categories descriptions --- definitions/declarations/httparchive.js | 7 +++++- .../output/reports/cwv_tech_categories.js | 23 +++++++++++++------ .../output/reports/cwv_tech_technologies.js | 2 +- .../output/wappalyzer/tech_detections.js | 6 ++--- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/definitions/declarations/httparchive.js b/definitions/declarations/httparchive.js index 7cbc384..2265d5a 100644 --- a/definitions/declarations/httparchive.js +++ b/definitions/declarations/httparchive.js @@ -8,5 +8,10 @@ for (const table of stagingTables) { declare({ schema: 'wappalyzer', - name: 'apps' + name: 'technologies' +}) + +declare({ + schema: 'wappalyzer', + name: 'categories' }) diff --git a/definitions/output/reports/cwv_tech_categories.js b/definitions/output/reports/cwv_tech_categories.js index 8db5a55..04ecdae 100644 --- a/definitions/output/reports/cwv_tech_categories.js +++ b/definitions/output/reports/cwv_tech_categories.js @@ -16,6 +16,11 @@ WITH pages AS ( client = 'mobile' ${constants.devRankFilter} ), categories AS ( + SELECT + name AS category, + description + FROM ${ctx.ref('wappalyzer', 'categories')} +), category_stats AS ( SELECT category, COUNT(DISTINCT root_page) AS origins @@ -23,7 +28,7 @@ WITH pages AS ( UNNEST(technologies) AS t, UNNEST(t.categories) AS category GROUP BY category -), technologies AS ( +), technology_stats AS ( SELECT category, technology, @@ -38,13 +43,17 @@ WITH pages AS ( SELECT category, - categories.origins, - ARRAY_AGG(technology IGNORE NULLS ORDER BY technologies.origins DESC) AS technologies -FROM categories -JOIN technologies + description, + category_stats.origins, + ARRAY_AGG(technology IGNORE NULLS ORDER BY technology_stats.origins DESC) AS technologies +FROM category_stats +INNER JOIN technology_stats +USING (category) +LEFT JOIN categories USING (category) GROUP BY category, - categories.origins -ORDER BY categories.origins DESC + description, + origins +ORDER BY origins DESC `) diff --git a/definitions/output/reports/cwv_tech_technologies.js b/definitions/output/reports/cwv_tech_technologies.js index fc543a8..f3e149c 100644 --- a/definitions/output/reports/cwv_tech_technologies.js +++ b/definitions/output/reports/cwv_tech_technologies.js @@ -15,7 +15,7 @@ SELECT NULL AS similar_technologies, origins FROM ${ctx.ref('core_web_vitals', 'technologies')} -LEFT JOIN ${ctx.ref('wappalyzer', 'apps')} +LEFT JOIN ${ctx.ref('wappalyzer', 'technologies')} ON app = name WHERE date = '${pastMonth}' AND geo = 'ALL' AND diff --git a/definitions/output/wappalyzer/tech_detections.js b/definitions/output/wappalyzer/tech_detections.js index 4a2a0d8..35f74df 100644 --- a/definitions/output/wappalyzer/tech_detections.js +++ b/definitions/output/wappalyzer/tech_detections.js @@ -112,7 +112,7 @@ tech_deprecated_gone_origins AS ( -- aggregation of technology adoption/deprecation metrics SELECT DATE('${constants.currentMonth}') AS date, - COALESCE(before_summary.technology, tech_adopted_existing_origins.technology, tech_adopted_new_origins.technology, apps.name) AS technology, + COALESCE(before_summary.technology, tech_adopted_existing_origins.technology, tech_adopted_new_origins.technology, technologies.name) AS technology, -- origins summary 0-COALESCE(total_origins_deprecated_existing, 0) AS total_origins_deprecated_existing, @@ -139,6 +139,6 @@ LEFT JOIN tech_deprecated_existing_origins ON before_summary.technology = tech_deprecated_existing_origins.technology LEFT JOIN tech_deprecated_gone_origins ON before_summary.technology = tech_deprecated_gone_origins.technology -FULL OUTER JOIN wappalyzer.apps - ON before_summary.technology = apps.name +FULL OUTER JOIN wappalyzer.technologies + ON before_summary.technology = technologies.name `)