|
1 | 1 | NODE project_insights_copy_base_projects |
2 | 2 | DESCRIPTION > |
3 | | - Returns base project information (id, name, slug, segmentId, softwareValue, healthScore, firstCommit) |
| 3 | + Returns base project information (id, name, slug, segmentId, logoUrl, isLF, contributorCount, organizationCount, softwareValue, healthScore, firstCommit) |
4 | 4 |
|
5 | 5 | SQL > |
6 | | - SELECT id, name, slug, segmentId, softwareValue, healthScore, firstCommit |
| 6 | + SELECT |
| 7 | + id, |
| 8 | + name, |
| 9 | + slug, |
| 10 | + segmentId, |
| 11 | + logoUrl, |
| 12 | + isLF, |
| 13 | + contributorCount, |
| 14 | + organizationCount, |
| 15 | + softwareValue, |
| 16 | + healthScore, |
| 17 | + firstCommit |
7 | 18 | FROM insights_projects_populated_ds |
8 | | - GROUP BY id, name, slug, segmentId, softwareValue, healthScore, firstCommit |
| 19 | + GROUP BY |
| 20 | + id, |
| 21 | + name, |
| 22 | + slug, |
| 23 | + segmentId, |
| 24 | + logoUrl, |
| 25 | + isLF, |
| 26 | + contributorCount, |
| 27 | + organizationCount, |
| 28 | + softwareValue, |
| 29 | + healthScore, |
| 30 | + firstCommit |
| 31 | + |
| 32 | +NODE project_insights_copy_dependency_metrics |
| 33 | +DESCRIPTION > |
| 34 | + Get contributor and organization dependency metrics from health_score_copy_ds |
| 35 | + |
| 36 | +SQL > |
| 37 | + SELECT |
| 38 | + slug, |
| 39 | + contributorDependencyCount, |
| 40 | + contributorDependencyPercentage, |
| 41 | + organizationDependencyCount, |
| 42 | + organizationDependencyPercentage |
| 43 | + FROM health_score_copy_ds |
| 44 | + |
| 45 | +NODE project_insights_copy_achievements |
| 46 | +DESCRIPTION > |
| 47 | + Aggregate leaderboard achievements per project from leaderboards_copy_ds (latest snapshot) |
| 48 | + |
| 49 | +SQL > |
| 50 | + SELECT slug, groupArray(tuple(leaderboardType, rank, totalCount)) AS achievements |
| 51 | + FROM leaderboards_copy_ds |
| 52 | + WHERE snapshotId = (SELECT max(snapshotId) FROM leaderboards_copy_ds) |
| 53 | + GROUP BY slug |
9 | 54 |
|
10 | 55 | NODE project_insights_copy_last_365_days_metrics |
11 | 56 | DESCRIPTION > |
|
50 | 95 | base.id AS id, |
51 | 96 | base.name AS name, |
52 | 97 | base.slug AS slug, |
| 98 | + base.logoUrl AS logoUrl, |
| 99 | + base.isLF AS isLF, |
| 100 | + base.contributorCount AS contributorCount, |
| 101 | + base.organizationCount AS organizationCount, |
53 | 102 | base.softwareValue AS softwareValue, |
| 103 | + COALESCE(dep.contributorDependencyCount, 0) AS contributorDependencyCount, |
| 104 | + COALESCE(dep.contributorDependencyPercentage, 0) AS contributorDependencyPercentage, |
| 105 | + COALESCE(dep.organizationDependencyCount, 0) AS organizationDependencyCount, |
| 106 | + COALESCE(dep.organizationDependencyPercentage, 0) AS organizationDependencyPercentage, |
| 107 | + COALESCE(ach.achievements, []) AS achievements, |
54 | 108 | base.healthScore AS healthScore, |
55 | 109 | base.firstCommit AS firstCommit, |
56 | 110 | l365.starsLast365Days AS starsLast365Days, |
|
62 | 116 | p365.activeContributorsPrevious365Days AS activeContributorsPrevious365Days, |
63 | 117 | p365.activeOrganizationsPrevious365Days AS activeOrganizationsPrevious365Days |
64 | 118 | FROM project_insights_copy_base_projects AS base |
| 119 | + LEFT JOIN project_insights_copy_dependency_metrics AS dep ON base.slug = dep.slug |
| 120 | + LEFT JOIN project_insights_copy_achievements AS ach ON base.slug = ach.slug |
65 | 121 | LEFT JOIN project_insights_copy_last_365_days_metrics AS l365 USING (segmentId) |
66 | 122 | LEFT JOIN project_insights_copy_previous_365_days_metrics AS p365 USING (segmentId) |
67 | 123 |
|
|
0 commit comments