@@ -38,15 +38,15 @@ with commits_data as (
38
38
select
39
39
' pstat,All' as repo_group,
40
40
' Projects/Repository groups' as name,
41
- count (distinct repo_group) as value
41
+ round(hll_cardinality(hll_add_agg(hll_hash_text( repo_group))) ) as value
42
42
from
43
43
gha_repos
44
44
where
45
45
repo_group is not null
46
46
union select
47
47
' pstat,All' as repo_group,
48
48
' Countries' as name,
49
- count (distinct sub .country_id ) as value
49
+ round(hll_cardinality(hll_add_agg(hll_hash_text( sub .country_id ))) ) as value
50
50
from (
51
51
select
52
52
a .country_id
83
83
union select
84
84
' pstat,' || sub .repo_group as repo_group,
85
85
' Countries' as name,
86
- count (distinct sub .country_id ) as value
86
+ round(hll_cardinality(hll_add_agg(hll_hash_text( sub .country_id ))) ) as value
87
87
from (
88
88
select
89
89
a .country_id ,
@@ -136,7 +136,7 @@ group by
136
136
union select
137
137
sub .repo_group ,
138
138
' Contributors' as name,
139
- count (distinct sub .actor ) as value
139
+ round(hll_cardinality(hll_add_agg(hll_hash_text( sub .actor ))) ) as value
140
140
from (
141
141
select ' pstat,' || r .repo_group as repo_group,
142
142
e .dup_actor_login as actor
@@ -159,7 +159,7 @@ group by
159
159
sub .repo_group
160
160
union select ' pstat,All' as repo_group,
161
161
' Contributors' as name,
162
- count (distinct dup_actor_login) as value
162
+ round(hll_cardinality(hll_add_agg(hll_hash_text( dup_actor_login))) ) as value
163
163
from
164
164
gha_events
165
165
where
@@ -172,7 +172,7 @@ where
172
172
union select
173
173
sub .repo_group ,
174
174
' Contributions' as name,
175
- count (distinct sub .id ) as value
175
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .id ))) ) as value
176
176
from (
177
177
select ' pstat,' || r .repo_group as repo_group,
178
178
e .id
@@ -195,7 +195,7 @@ group by
195
195
sub .repo_group
196
196
union select ' pstat,All' as repo_group,
197
197
' Contributions' as name,
198
- count (distinct id ) as value
198
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint(id))) ) as value
199
199
from
200
200
gha_events
201
201
where
@@ -208,7 +208,7 @@ where
208
208
union select
209
209
sub .repo_group ,
210
210
' Pushes' as name,
211
- count (distinct sub .id ) as value
211
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .id ))) ) as value
212
212
from (
213
213
select ' pstat,' || r .repo_group as repo_group,
214
214
e .id
@@ -228,7 +228,7 @@ group by
228
228
sub .repo_group
229
229
union select ' pstat,All' as repo_group,
230
230
' Pushes' as name,
231
- count (distinct id ) as value
231
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint(id))) ) as value
232
232
from
233
233
gha_events
234
234
where
@@ -237,7 +237,7 @@ where
237
237
and type = ' PushEvent'
238
238
union select ' pstat,' || c .repo_group as repo_group,
239
239
' Commits' as name,
240
- count (distinct c .sha ) as value
240
+ round(hll_cardinality(hll_add_agg(hll_hash_text( c .sha ))) ) as value
241
241
from
242
242
commits_data c
243
243
where
@@ -246,12 +246,12 @@ group by
246
246
c .repo_group
247
247
union select ' pstat,All' as repo_group,
248
248
' Commits' as name,
249
- count (distinct c .sha ) as value
249
+ round(hll_cardinality(hll_add_agg(hll_hash_text( c .sha ))) ) as value
250
250
from
251
251
commits_data c
252
252
union select ' pstat,' || c .repo_group as repo_group,
253
253
' Code committers' as name,
254
- count (distinct c .actor_id ) as value
254
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( c .actor_id ))) ) as value
255
255
from
256
256
commits_data c
257
257
where
@@ -260,7 +260,7 @@ group by
260
260
c .repo_group
261
261
union select ' pstat,All' as repo_group,
262
262
' Code committers' as name,
263
- count (distinct c .actor_id ) as value
263
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( c .actor_id ))) ) as value
264
264
from
265
265
commits_data c
266
266
union select sub .repo_group ,
@@ -275,7 +275,7 @@ union select sub.repo_group,
275
275
when ' WatchEvent' then ' Stargazers/Watchers'
276
276
when ' ForkEvent' then ' Forkers'
277
277
end as name,
278
- count (distinct sub .actor_id ) as value
278
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .actor_id ))) ) as value
279
279
from (
280
280
select ' pstat,' || r .repo_group as repo_group,
281
281
e .type ,
@@ -311,7 +311,7 @@ union select 'pstat,All' as repo_group,
311
311
when ' WatchEvent' then ' Stargazers/Watchers'
312
312
when ' ForkEvent' then ' Forkers'
313
313
end as name,
314
- count (distinct actor_id) as value
314
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( actor_id))) ) as value
315
315
from
316
316
gha_events
317
317
where
@@ -326,7 +326,7 @@ group by
326
326
type
327
327
union select ' pstat,' || r .repo_group as repo_group,
328
328
' Repositories' as name,
329
- count (distinct e .repo_id ) as value
329
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( e .repo_id ))) ) as value
330
330
from
331
331
gha_events e,
332
332
gha_repos r
@@ -339,14 +339,14 @@ group by
339
339
r .repo_group
340
340
union select ' pstat,All' as repo_group,
341
341
' Repositories' as name,
342
- count (distinct repo_id) as value
342
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( repo_id))) ) as value
343
343
from
344
344
gha_events
345
345
where
346
346
{{period:created_at}}
347
347
union select sub .repo_group ,
348
348
' Comments' as name,
349
- count (distinct sub .id ) as value
349
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .id ))) ) as value
350
350
from (
351
351
select ' pstat,' || r .repo_group as repo_group,
352
352
c .id
@@ -365,15 +365,15 @@ group by
365
365
sub .repo_group
366
366
union select ' pstat,All' as repo_group,
367
367
' Comments' as name,
368
- count (distinct id ) as value
368
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint(id))) ) as value
369
369
from
370
370
gha_comments
371
371
where
372
372
{{period:created_at}}
373
373
and (lower (dup_user_login) {{exclude_bots}})
374
374
union select sub .repo_group ,
375
375
' Commenters' as name,
376
- count (distinct sub .user_id ) as value
376
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .user_id ))) ) as value
377
377
from (
378
378
select ' pstat,' || r .repo_group as repo_group,
379
379
c .user_id
@@ -392,15 +392,15 @@ group by
392
392
sub .repo_group
393
393
union select ' pstat,All' as repo_group,
394
394
' Commenters' as name,
395
- count (distinct user_id) as value
395
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( user_id))) ) as value
396
396
from
397
397
gha_comments
398
398
where
399
399
{{period:created_at}}
400
400
and (lower (dup_user_login) {{exclude_bots}})
401
401
union select sub .repo_group ,
402
402
' PR reviews' as name,
403
- count (distinct sub .id ) as value
403
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .id ))) ) as value
404
404
from (
405
405
select ' pstat,' || r .repo_group as repo_group,
406
406
c .id
@@ -419,15 +419,15 @@ group by
419
419
sub .repo_group
420
420
union select ' pstat,All' as repo_group,
421
421
' PR reviews' as name,
422
- count (distinct id ) as value
422
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint(id))) ) as value
423
423
from
424
424
gha_reviews
425
425
where
426
426
{{period:submitted_at}}
427
427
and (lower (dup_user_login) {{exclude_bots}})
428
428
union select sub .repo_group ,
429
429
' Issues' as name,
430
- count (distinct sub .id ) as value
430
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .id ))) ) as value
431
431
from (
432
432
select ' pstat,' || r .repo_group as repo_group,
433
433
i .id
@@ -447,7 +447,7 @@ group by
447
447
sub .repo_group
448
448
union select ' pstat,All' as repo_group,
449
449
' Issues' as name,
450
- count (distinct id ) as value
450
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint(id))) ) as value
451
451
from
452
452
gha_issues
453
453
where
@@ -456,7 +456,7 @@ where
456
456
and (lower (dup_user_login) {{exclude_bots}})
457
457
union select sub .repo_group ,
458
458
' PRs' as name,
459
- count (distinct sub .id ) as value
459
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint( sub .id ))) ) as value
460
460
from (
461
461
select ' pstat,' || r .repo_group as repo_group,
462
462
i .id
@@ -476,7 +476,7 @@ group by
476
476
sub .repo_group
477
477
union select ' pstat,All' as repo_group,
478
478
' PRs' as name,
479
- count (distinct id ) as value
479
+ round(hll_cardinality(hll_add_agg(hll_hash_bigint(id))) ) as value
480
480
from
481
481
gha_issues
482
482
where
0 commit comments