Skip to content

Commit d4a40fb

Browse files
committed
versions
1 parent 1fe4364 commit d4a40fb

1 file changed

Lines changed: 7 additions & 52 deletions

File tree

definitions/output/reports/tech_report_versions.js

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,16 @@ publish('tech_report_versions', {
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-
REGEXP_EXTRACT(version, r'\\d+(?:\\.\\d+)?') AS version
14-
FROM ${ctx.ref('crawl', 'pages')} AS pages
15-
INNER JOIN pages.technologies AS tech
16-
LEFT JOIN tech.info AS version
17-
WHERE
18-
date = '${pastMonth}'
19-
${constants.devRankFilter} AND
20-
tech.technology IS NOT NULL
21-
),
22-
23-
version_origins AS (
24-
SELECT
25-
client,
26-
technology,
27-
version,
28-
COUNT(DISTINCT root_page) AS origins
29-
FROM pages
30-
WHERE version IS NOT NULL
31-
GROUP BY
32-
client,
33-
technology,
34-
version
35-
),
36-
37-
total_origins AS (
38-
SELECT
39-
client,
40-
technology,
41-
COUNT(DISTINCT root_page) AS origins
42-
FROM pages
43-
GROUP BY
44-
client,
45-
technology
46-
)
47-
488
SELECT
49-
client,
509
technology,
5110
version,
52-
origins
53-
FROM version_origins
54-
55-
UNION ALL
56-
57-
SELECT
58-
client,
59-
technology,
60-
'ALL' AS version,
61-
origins
62-
FROM total_origins
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+
${constants.devRankFilter}
6318
`).postOps(ctx => `
6419
SELECT
6520
reports.run_export_job(

0 commit comments

Comments
 (0)