Skip to content

Commit

Permalink
add category descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ostapenko committed Dec 23, 2024
1 parent 2fe9ec0 commit 72eecd6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
5 changes: 5 additions & 0 deletions definitions/declarations/httparchive.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ declare({
schema: 'wappalyzer',
name: 'technologies'
})

declare({
schema: 'wappalyzer',
name: 'categories'
})
23 changes: 16 additions & 7 deletions definitions/output/reports/cwv_tech_categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ WITH pages AS (
client = 'mobile'
${constants.devRankFilter}
), categories AS (
SELECT
name AS category,
description
FROM ${ctx.ref('wappalyzer', 'categories')}
), categories_stats AS (
SELECT
category,
COUNT(DISTINCT root_page) AS origins
FROM pages,
UNNEST(technologies) AS t,
UNNEST(t.categories) AS category
GROUP BY category
), technologies AS (
), technologies_stats AS (
SELECT
category,
technology,
Expand All @@ -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
INNER JOIN technologies
description,
categories_stats.origins,
ARRAY_AGG(technology IGNORE NULLS ORDER BY technologies_stats.origins DESC) AS technologies
FROM categories_stats
INNER JOIN technologies_stats
USING (category)
LEFT JOIN categories
USING (category)
GROUP BY
category,
categories.origins
ORDER BY categories.origins DESC
description,
origins
ORDER BY origins DESC
`)

0 comments on commit 72eecd6

Please sign in to comment.