File tree Expand file tree Collapse file tree 1 file changed +63
-9
lines changed
definitions/output/reports Expand file tree Collapse file tree 1 file changed +63
-9
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,73 @@ publish('cwv_tech_technologies', {
6
6
tags : [ 'crux_ready' ]
7
7
} ) . query ( ctx => `
8
8
/* {"dataform_trigger": "report_cwv_tech_complete", "name": "technologies", "type": "dict"} */
9
+ WITH pages AS (
10
+ SELECT DISTINCT
11
+ client,
12
+ root_page,
13
+ tech.technology
14
+ FROM ${ ctx . ref ( 'crawl' , 'pages' ) } ,
15
+ UNNEST(technologies) AS tech
16
+ WHERE
17
+ date = '${ pastMonth } '
18
+ ${ constants . devRankFilter }
19
+ ),
20
+
21
+ tech_origins AS (
22
+ SELECT
23
+ client,
24
+ technology,
25
+ COUNT(DISTINCT root_page) AS origins
26
+ FROM pages
27
+ GROUP BY
28
+ client,
29
+ technology
30
+ ),
31
+
32
+ technologies AS (
33
+ SELECT
34
+ name AS technology,
35
+ description,
36
+ STRING_AGG(DISTINCT category, ', ' ORDER BY category ASC) AS category,
37
+ categories AS category_obj,
38
+ NULL AS similar_technologies
39
+ FROM ${ ctx . ref ( 'wappalyzer' , 'technologies' ) } ,
40
+ UNNEST(categories) AS category
41
+ GROUP BY
42
+ technology,
43
+ description,
44
+ categories
45
+ ),
46
+
47
+ total_pages AS (
48
+ SELECT
49
+ client,
50
+ COUNT(DISTINCT root_page) AS origins
51
+ FROM pages
52
+ GROUP BY client
53
+ )
54
+
9
55
SELECT
10
56
client,
11
- app AS technology,
57
+ technology,
12
58
description,
13
59
category,
14
- SPLIT(category, ",") AS category_obj,
60
+ category_obj,
61
+ similar_technologies,
62
+ origins
63
+ FROM tech_origins
64
+ INNER JOIN technologies
65
+ USING(technology)
66
+
67
+ UNION ALL
68
+
69
+ SELECT
70
+ client,
71
+ 'ALL' AS technology,
72
+ NULL AS description,
73
+ NULL AS category,
74
+ NULL AS category_obj,
15
75
NULL AS similar_technologies,
16
76
origins
17
- FROM ${ ctx . ref ( 'core_web_vitals' , 'technologies' ) }
18
- LEFT JOIN ${ ctx . ref ( 'wappalyzer' , 'technologies' ) }
19
- ON app = name
20
- WHERE date = '${ pastMonth } ' AND
21
- geo = 'ALL' AND
22
- rank = 'ALL'
23
- ORDER BY origins DESC
77
+ FROM total_pages
24
78
` )
You can’t perform that action at this time.
0 commit comments