|
1 | | --- !!! Query is not converted to CH syntax yet. Delete this line when it gets converted |
| 1 | +with jobs as ( |
| 2 | + select |
| 3 | + j.torchci_classification.line as line, |
| 4 | + j.torchci_classification.captures as captures, |
| 5 | + j.run_id |
| 6 | + from |
| 7 | + default.workflow_job j final |
| 8 | + where |
| 9 | + j.id in ( |
| 10 | + select id from materialized_views.workflow_job_by_created_at |
| 11 | + where created_at >= {startTime: DateTime64(3)} and created_at < {stopTime: DateTime64(3)} |
| 12 | + ) |
| 13 | + and j.conclusion in ('cancelled', 'failure', 'time_out') |
| 14 | +) |
2 | 15 | select |
3 | 16 | COUNT(*) as num, |
4 | | - ARBITRARY(j.torchci_classification.line) as example, |
5 | | - j.torchci_classification.captures as captures, |
6 | | - ARRAY_JOIN(j.torchci_classification.captures, '%') as search_string |
| 17 | + any(line) as example, |
| 18 | + captures as captures |
7 | 19 | from |
8 | | - workflow_job j |
9 | | - join workflow_run w on w.id = j.run_id |
| 20 | + jobs j |
| 21 | + join default.workflow_run w final on w.id = j.run_id |
10 | 22 | where |
11 | | - j._event_time >= PARSE_TIMESTAMP_ISO8601(:startTime) |
12 | | - and j._event_time < PARSE_TIMESTAMP_ISO8601(:stopTime) |
| 23 | + w.id in (select run_id from jobs) |
13 | 24 | and w.head_branch = 'main' |
14 | | - and w.head_repository.full_name = 'pytorch/pytorch' |
15 | | - and j.conclusion in ('cancelled', 'failure', 'time_out') |
| 25 | + and w.head_repository.'full_name' = 'pytorch/pytorch' |
16 | 26 | AND w.event != 'workflow_run' |
17 | 27 | AND w.event != 'repository_dispatch' |
18 | 28 | group by |
19 | | - j.torchci_classification.captures |
| 29 | + captures |
20 | 30 | order by |
21 | 31 | COUNT(*) desc |
0 commit comments