Skip to content

Commit 0f03d64

Browse files
committed
technologies
1 parent d4a40fb commit 0f03d64

1 file changed

Lines changed: 14 additions & 43 deletions

File tree

definitions/output/reports/tech_report_technologies.js

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,17 @@ publish('tech_report_technologies', {
55
type: 'table',
66
tags: ['tech_report']
77
}).query(ctx => `
8-
WITH pages AS (
9-
SELECT DISTINCT
10-
client,
11-
root_page,
12-
tech.technology
13-
FROM ${ctx.ref('crawl', 'pages')} AS pages
14-
INNER JOIN pages.technologies AS tech
15-
WHERE
16-
date = '${pastMonth}'
17-
${constants.devRankFilter}
18-
),
19-
20-
tech_origins AS (
8+
WITH tech_origins AS (
219
SELECT
22-
technology,
23-
STRUCT(
24-
MAX(IF(client = 'desktop', origins, 0)) AS desktop,
25-
MAX(IF(client = 'mobile', origins, 0)) AS mobile
26-
) AS origins
27-
FROM (
28-
SELECT
29-
client,
30-
technology,
31-
COUNT(DISTINCT root_page) AS origins
32-
FROM pages
33-
GROUP BY
34-
client,
35-
technology
36-
)
37-
GROUP BY technology
10+
technology,
11+
adoption AS origins
12+
FROM ${ctx.ref('reports', 'tech_report_adoption')}
13+
WHERE
14+
date = '${pastMonth}'
15+
AND rank = 'ALL'
16+
AND geo = 'ALL'
17+
AND version = 'ALL'
18+
${constants.devRankFilter}
3819
),
3920
4021
technologies AS (
@@ -51,14 +32,6 @@ technologies AS (
5132
description,
5233
categories,
5334
icon
54-
),
55-
56-
total_pages AS (
57-
SELECT
58-
client,
59-
COUNT(DISTINCT root_page) AS origins
60-
FROM pages
61-
GROUP BY client
6235
)
6336
6437
SELECT
@@ -75,16 +48,14 @@ USING(technology)
7548
UNION ALL
7649
7750
SELECT
78-
'ALL' AS technology,
51+
technology,
7952
NULL AS description,
8053
NULL AS icon,
8154
NULL AS category,
8255
NULL AS category_obj,
83-
STRUCT(
84-
MAX(IF(client = 'desktop', origins, 0)) AS desktop,
85-
MAX(IF(client = 'mobile', origins, 0)) AS mobile
86-
) AS origins
87-
FROM total_pages
56+
origins
57+
FROM tech_origins
58+
WHERE technology = 'ALL'
8859
`).postOps(ctx => `
8960
SELECT
9061
reports.run_export_job(

0 commit comments

Comments
 (0)