Skip to content

Commit 5142f9b

Browse files
committed
Lint
1 parent 0fa9e69 commit 5142f9b

2 files changed

Lines changed: 42 additions & 42 deletions

File tree

sql/2025/webassembly/counts.sql

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
# Query for wasm requests' count with distinct wasm origin name
22

33
WITH wasmRequests AS (
4-
SELECT
5-
client,
6-
page,
7-
CASE
8-
WHEN REGEXP_CONTAINS(url, r'/(hyphenopoly|patterns).*/[a-z-]{2,5}\.wasm')
9-
THEN '(hyphenopoly dictionary)'
10-
WHEN ENDS_WITH(url, '.unityweb')
11-
THEN '(unityweb app)'
12-
ELSE
13-
REGEXP_REPLACE(
14-
REGEXP_EXTRACT(LOWER(url), r'./([^./?])'), -- lowercase & extract filename between last `/` and `.` or `?`
15-
r'-[0-9a-f]{20,32}$', -- trim trailing hashes to transform `name-0abc43234[...]` to `name`
16-
''
17-
)
18-
END AS name
19-
FROM
20-
`httparchive.crawl.requests`
21-
WHERE
22-
date = '2025-07-01' AND
23-
type = 'wasm'
4+
SELECT
5+
client,
6+
page,
7+
CASE
8+
WHEN REGEXP_CONTAINS(url, r'/(hyphenopoly|patterns).*/[a-z-]{2,5}\.wasm')
9+
THEN '(hyphenopoly dictionary)'
10+
WHEN ENDS_WITH(url, '.unityweb')
11+
THEN '(unityweb app)'
12+
ELSE
13+
REGEXP_REPLACE(
14+
REGEXP_EXTRACT(LOWER(url), r'./([^./?])'), -- lowercase & extract filename between last `/` and `.` or `?`
15+
r'-[0-9a-f]{20,32}$', -- trim trailing hashes to transform `name-0abc43234[...]` to `name`
16+
''
17+
)
18+
END AS name
19+
FROM
20+
`httparchive.crawl.requests`
21+
WHERE
22+
date = '2025-07-01' AND
23+
type = 'wasm'
2424
)
2525

2626
SELECT
27-
client,
28-
COUNT(0) AS total_wasm,
29-
COUNT(DISTINCT NET.REG_DOMAIN(page)) AS distinct_origin
27+
client,
28+
COUNT(0) AS total_wasm,
29+
COUNT(DISTINCT NET.REG_DOMAIN(page)) AS distinct_origin
3030
FROM
31-
wasmRequests
31+
wasmRequests
3232
GROUP BY
33-
client
33+
client
3434
ORDER BY
35-
client
35+
client
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
SELECT
2-
client,
3-
rank_grouping,
4-
CASE
5-
WHEN rank_grouping = 100000000 THEN 'all'
6-
ELSE CAST(rank_grouping AS STRING)
7-
END AS ranking,
8-
COUNT(DISTINCT page) AS pages
2+
client,
3+
rank_grouping,
4+
CASE
5+
WHEN rank_grouping = 100000000 THEN 'all'
6+
ELSE CAST(rank_grouping AS STRING)
7+
END AS ranking,
8+
COUNT(DISTINCT page) AS pages
99
FROM
10-
`httparchive.crawl.requests`,
11-
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS rank_grouping
10+
`httparchive.crawl.requests`,
11+
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS rank_grouping
1212
WHERE
13-
date = '2025-07-01' AND
14-
type = 'wasm' AND
15-
rank <= rank_grouping
13+
date = '2025-07-01' AND
14+
type = 'wasm' AND
15+
rank <= rank_grouping
1616
GROUP BY
17-
client,
18-
rank_grouping
17+
client,
18+
rank_grouping
1919
ORDER BY
20-
client,
21-
rank_grouping
20+
client,
21+
rank_grouping

0 commit comments

Comments
 (0)