File tree Expand file tree Collapse file tree
definitions/output/reports Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,12 +58,14 @@ category_stats AS (
5858
5959technology_stats AS (
6060 SELECT
61- client,
62- technology,
63- category_obj AS categories,
64- IF(client = 'mobile', origins.mobile, origins.desktop) AS origins
61+ category,
62+ STRUCT(
63+ ARRAY_AGG(technology IGNORE NULLS ORDER BY origins.mobile DESC) AS mobile,
64+ ARRAY_AGG(technology IGNORE NULLS ORDER BY origins.desktop DESC) AS desktop
65+ ) AS technologies
6566 FROM ${ ctx . ref ( 'reports' , 'tech_report_technologies' ) } ,
66- UNNEST(ARRAY['desktop', 'mobile']) AS client
67+ UNNEST(category_obj) AS category
68+ GROUP BY category
6769)
6870
6971SELECT
@@ -73,18 +75,14 @@ SELECT
7375 origins,
7476 IF(
7577 client = 'mobile',
76- ARRAY_AGG(technology IGNORE NULLS ORDER BY technology_stats.origins. mobile DESC) ,
77- ARRAY_AGG(technology IGNORE NULLS ORDER BY technology_stats.origins. desktop DESC)
78+ technologies. mobile,
79+ technologies. desktop
7880 ) AS technologies
7981FROM category_stats
8082INNER JOIN technology_stats
81- ON category_stats.category IN UNNEST(technology_stats.categories )
83+ USING (category )
8284INNER JOIN category_descriptions
83- USING (category, client)
84- GROUP BY
85- category,
86- description,
87- origins
85+ USING (category)
8886
8987UNION ALL
9088
You can’t perform that action at this time.
0 commit comments