-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: frank-zsy <[email protected]>
- Loading branch information
Showing
11 changed files
with
615 additions
and
24 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
test/testdata/contributors/contributors_desc_3_all_null_month.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{ | ||
"sql": "\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('month', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(inactive_contributors, 2),\n toUInt32(dateDiff('month', toDate('2015-1-1'), time)-1)) AS inactive_contributors,\n groupArrayInsertAt(\n [],\n toUInt32(dateDiff('month', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(detail,\n toUInt32(dateDiff('month', toDate('2015-1-1'), time)-1)) AS detail\nFROM\n(\n SELECT\n id,\n argMax(name, time) AS name,\n time,\n countIf(first_time < time AND contributions <= 0) AS inactive_contributors,\n groupArrayIf(author, first_time < time AND contributions <= 0) AS detail\n FROM\n (\n SELECT\n arrayJoin(arrayMap(x -> dateAdd(month, x + 1, toDate('2015-1-1')), range(toUInt64(dateDiff('month', toDate('2015-1-1'), toDate('2017-1-1')))))) AS time,\n repo_id AS id, argMax(repo_name, time) AS name,\n actor_id, argMax(author, created_at) AS author,\n min(created_at) AS first_time,\n countIf(created_at >= dateSub(month, 6, time) AND created_at <= time) AS contributions\n FROM\n (\n SELECT \n repo_id,\n repo_name,\n org_id,\n org_login,\n issue_author_id AS actor_id, issue_author_login AS author,\n created_at\n FROM gh_events\n WHERE type = 'PullRequestEvent' AND action = 'closed' AND pull_merged = 1 AND (org_id IN [1342004]) AND created_at < toDate('2017-1-1')\n HAVING author NOT LIKE '%[bot]'\n )\n GROUP BY id, actor_id, time\n )\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY inactive_contributors[-1] DESC\n LIMIT 3", | ||
"modifiedOption": { | ||
"orgIds": [ | ||
1342004 | ||
], | ||
"startYear": 2015, | ||
"endYear": 2016, | ||
"startMonth": 1, | ||
"endMonth": 12, | ||
"order": "DESC", | ||
"limit": 3, | ||
"limitOption": "all", | ||
"groupTimeRange": "month", | ||
"groupBy": null | ||
}, | ||
"contributors_desc_3_all_null_month": [ | ||
{ | ||
"id": "63809205", | ||
"name": "google/oss-fuzz", | ||
"count": [ | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"1", | ||
"2", | ||
"8", | ||
"7", | ||
"36" | ||
] | ||
}, | ||
{ | ||
"id": "19249835", | ||
"name": "google/WebFundamentals", | ||
"count": [ | ||
"6", | ||
"4", | ||
"8", | ||
"6", | ||
"17", | ||
"7", | ||
"15", | ||
"12", | ||
"14", | ||
"22", | ||
"15", | ||
"20", | ||
"17", | ||
"23", | ||
"30", | ||
"19", | ||
"15", | ||
"25", | ||
"24", | ||
"22", | ||
"29", | ||
"33", | ||
"21", | ||
"24" | ||
] | ||
}, | ||
{ | ||
"id": "23357588", | ||
"name": "google/protobuf", | ||
"count": [ | ||
"3", | ||
"10", | ||
"10", | ||
"9", | ||
"19", | ||
"17", | ||
"12", | ||
"18", | ||
"11", | ||
"15", | ||
"14", | ||
"15", | ||
"14", | ||
"21", | ||
"18", | ||
"18", | ||
"22", | ||
"14", | ||
"20", | ||
"18", | ||
"25", | ||
"16", | ||
"23", | ||
"22" | ||
] | ||
} | ||
] | ||
} |
61 changes: 61 additions & 0 deletions
61
test/testdata/contributors/contributors_desc_3_all_null_quarter.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"sql": "\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('quarter', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(inactive_contributors, 2),\n toUInt32(dateDiff('quarter', toStartOfQuarter(toDate('2015-1-1')), time)-1)) AS inactive_contributors,\n groupArrayInsertAt(\n [],\n toUInt32(dateDiff('quarter', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(detail,\n toUInt32(dateDiff('quarter', toStartOfQuarter(toDate('2015-1-1')), time)-1)) AS detail\nFROM\n(\n SELECT\n id,\n argMax(name, time) AS name,\n time,\n countIf(first_time < time AND contributions <= 0) AS inactive_contributors,\n groupArrayIf(author, first_time < time AND contributions <= 0) AS detail\n FROM\n (\n SELECT\n arrayJoin(arrayMap(x -> dateAdd(quarter, x + 1, toDate('2015-1-1')), range(toUInt64(dateDiff('quarter', toDate('2015-1-1'), toDate('2017-1-1')))))) AS time,\n repo_id AS id, argMax(repo_name, time) AS name,\n actor_id, argMax(author, created_at) AS author,\n min(created_at) AS first_time,\n countIf(created_at >= dateSub(month, 6, time) AND created_at <= time) AS contributions\n FROM\n (\n SELECT \n repo_id,\n repo_name,\n org_id,\n org_login,\n issue_author_id AS actor_id, issue_author_login AS author,\n created_at\n FROM gh_events\n WHERE type = 'PullRequestEvent' AND action = 'closed' AND pull_merged = 1 AND (org_id IN [1342004]) AND created_at < toDate('2017-1-1')\n HAVING author NOT LIKE '%[bot]'\n )\n GROUP BY id, actor_id, time\n )\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY inactive_contributors[-1] DESC\n LIMIT 3", | ||
"modifiedOption": { | ||
"orgIds": [ | ||
1342004 | ||
], | ||
"startYear": 2015, | ||
"endYear": 2016, | ||
"startMonth": 1, | ||
"endMonth": 12, | ||
"order": "DESC", | ||
"limit": 3, | ||
"limitOption": "all", | ||
"groupTimeRange": "quarter", | ||
"groupBy": null | ||
}, | ||
"contributors_desc_3_all_null_quarter": [ | ||
{ | ||
"id": "19249835", | ||
"name": "google/WebFundamentals", | ||
"count": [ | ||
"15", | ||
"24", | ||
"27", | ||
"37", | ||
"50", | ||
"41", | ||
"53", | ||
"51" | ||
] | ||
}, | ||
{ | ||
"id": "23357588", | ||
"name": "google/protobuf", | ||
"count": [ | ||
"20", | ||
"25", | ||
"29", | ||
"34", | ||
"41", | ||
"40", | ||
"51", | ||
"45" | ||
] | ||
}, | ||
{ | ||
"id": "63809205", | ||
"name": "google/oss-fuzz", | ||
"count": [ | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"0", | ||
"3", | ||
"40" | ||
] | ||
} | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
test/testdata/contributors/contributors_desc_3_all_null_year.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"sql": "\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('year', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(inactive_contributors, 2),\n toUInt32(dateDiff('year', toStartOfYear(toDate('2015-1-1')), time)-1)) AS inactive_contributors,\n groupArrayInsertAt(\n [],\n toUInt32(dateDiff('year', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(detail,\n toUInt32(dateDiff('year', toStartOfYear(toDate('2015-1-1')), time)-1)) AS detail\nFROM\n(\n SELECT\n id,\n argMax(name, time) AS name,\n time,\n countIf(first_time < time AND contributions <= 0) AS inactive_contributors,\n groupArrayIf(author, first_time < time AND contributions <= 0) AS detail\n FROM\n (\n SELECT\n arrayJoin(arrayMap(x -> dateAdd(year, x + 1, toDate('2015-1-1')), range(toUInt64(dateDiff('year', toDate('2015-1-1'), toDate('2017-1-1')))))) AS time,\n repo_id AS id, argMax(repo_name, time) AS name,\n actor_id, argMax(author, created_at) AS author,\n min(created_at) AS first_time,\n countIf(created_at >= dateSub(month, 6, time) AND created_at <= time) AS contributions\n FROM\n (\n SELECT \n repo_id,\n repo_name,\n org_id,\n org_login,\n issue_author_id AS actor_id, issue_author_login AS author,\n created_at\n FROM gh_events\n WHERE type = 'PullRequestEvent' AND action = 'closed' AND pull_merged = 1 AND (org_id IN [1342004]) AND created_at < toDate('2017-1-1')\n HAVING author NOT LIKE '%[bot]'\n )\n GROUP BY id, actor_id, time\n )\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY inactive_contributors[-1] DESC\n LIMIT 3", | ||
"modifiedOption": { | ||
"orgIds": [ | ||
1342004 | ||
], | ||
"startYear": 2015, | ||
"endYear": 2016, | ||
"startMonth": 1, | ||
"endMonth": 12, | ||
"order": "DESC", | ||
"limit": 3, | ||
"limitOption": "all", | ||
"groupTimeRange": "year", | ||
"groupBy": null | ||
}, | ||
"contributors_desc_3_all_null_year": [ | ||
{ | ||
"id": "23357588", | ||
"name": "google/protobuf", | ||
"count": [ | ||
"79", | ||
"138" | ||
] | ||
}, | ||
{ | ||
"id": "19249835", | ||
"name": "google/WebFundamentals", | ||
"count": [ | ||
"77", | ||
"131" | ||
] | ||
}, | ||
{ | ||
"id": "19953044", | ||
"name": "google/flatbuffers", | ||
"count": [ | ||
"37", | ||
"76" | ||
] | ||
} | ||
] | ||
} |
49 changes: 49 additions & 0 deletions
49
test/testdata/contributors/contributors_desc_3_all_org_month.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"sql": "\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('month', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(inactive_contributors, 2),\n toUInt32(dateDiff('month', toDate('2015-1-1'), time)-1)) AS inactive_contributors,\n groupArrayInsertAt(\n [],\n toUInt32(dateDiff('month', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(detail,\n toUInt32(dateDiff('month', toDate('2015-1-1'), time)-1)) AS detail\nFROM\n(\n SELECT\n id,\n argMax(name, time) AS name,\n time,\n countIf(first_time < time AND contributions <= 0) AS inactive_contributors,\n groupArrayIf(author, first_time < time AND contributions <= 0) AS detail\n FROM\n (\n SELECT\n arrayJoin(arrayMap(x -> dateAdd(month, x + 1, toDate('2015-1-1')), range(toUInt64(dateDiff('month', toDate('2015-1-1'), toDate('2017-1-1')))))) AS time,\n org_id AS id, argMax(org_login, time) AS name,\n actor_id, argMax(author, created_at) AS author,\n min(created_at) AS first_time,\n countIf(created_at >= dateSub(month, 6, time) AND created_at <= time) AS contributions\n FROM\n (\n SELECT \n repo_id,\n repo_name,\n org_id,\n org_login,\n issue_author_id AS actor_id, issue_author_login AS author,\n created_at\n FROM gh_events\n WHERE type = 'PullRequestEvent' AND action = 'closed' AND pull_merged = 1 AND (org_id IN [1342004]) AND created_at < toDate('2017-1-1')\n HAVING author NOT LIKE '%[bot]'\n )\n GROUP BY id, actor_id, time\n )\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY inactive_contributors[-1] DESC\n LIMIT 3", | ||
"modifiedOption": { | ||
"orgIds": [ | ||
1342004 | ||
], | ||
"startYear": 2015, | ||
"endYear": 2016, | ||
"startMonth": 1, | ||
"endMonth": 12, | ||
"order": "DESC", | ||
"limit": 3, | ||
"limitOption": "all", | ||
"groupTimeRange": "month", | ||
"groupBy": "org" | ||
}, | ||
"contributors_desc_3_all_org_month": [ | ||
{ | ||
"id": "1342004", | ||
"name": "google", | ||
"count": [ | ||
"161", | ||
"184", | ||
"221", | ||
"209", | ||
"213", | ||
"220", | ||
"290", | ||
"303", | ||
"266", | ||
"299", | ||
"249", | ||
"263", | ||
"297", | ||
"331", | ||
"296", | ||
"278", | ||
"299", | ||
"293", | ||
"313", | ||
"309", | ||
"321", | ||
"324", | ||
"269", | ||
"320" | ||
] | ||
} | ||
] | ||
} |
33 changes: 33 additions & 0 deletions
33
test/testdata/contributors/contributors_desc_3_all_org_quarter.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"sql": "\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('quarter', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(inactive_contributors, 2),\n toUInt32(dateDiff('quarter', toStartOfQuarter(toDate('2015-1-1')), time)-1)) AS inactive_contributors,\n groupArrayInsertAt(\n [],\n toUInt32(dateDiff('quarter', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(detail,\n toUInt32(dateDiff('quarter', toStartOfQuarter(toDate('2015-1-1')), time)-1)) AS detail\nFROM\n(\n SELECT\n id,\n argMax(name, time) AS name,\n time,\n countIf(first_time < time AND contributions <= 0) AS inactive_contributors,\n groupArrayIf(author, first_time < time AND contributions <= 0) AS detail\n FROM\n (\n SELECT\n arrayJoin(arrayMap(x -> dateAdd(quarter, x + 1, toDate('2015-1-1')), range(toUInt64(dateDiff('quarter', toDate('2015-1-1'), toDate('2017-1-1')))))) AS time,\n org_id AS id, argMax(org_login, time) AS name,\n actor_id, argMax(author, created_at) AS author,\n min(created_at) AS first_time,\n countIf(created_at >= dateSub(month, 6, time) AND created_at <= time) AS contributions\n FROM\n (\n SELECT \n repo_id,\n repo_name,\n org_id,\n org_login,\n issue_author_id AS actor_id, issue_author_login AS author,\n created_at\n FROM gh_events\n WHERE type = 'PullRequestEvent' AND action = 'closed' AND pull_merged = 1 AND (org_id IN [1342004]) AND created_at < toDate('2017-1-1')\n HAVING author NOT LIKE '%[bot]'\n )\n GROUP BY id, actor_id, time\n )\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY inactive_contributors[-1] DESC\n LIMIT 3", | ||
"modifiedOption": { | ||
"orgIds": [ | ||
1342004 | ||
], | ||
"startYear": 2015, | ||
"endYear": 2016, | ||
"startMonth": 1, | ||
"endMonth": 12, | ||
"order": "DESC", | ||
"limit": 3, | ||
"limitOption": "all", | ||
"groupTimeRange": "quarter", | ||
"groupBy": "org" | ||
}, | ||
"contributors_desc_3_all_org_quarter": [ | ||
{ | ||
"id": "1342004", | ||
"name": "google", | ||
"count": [ | ||
"438", | ||
"471", | ||
"639", | ||
"601", | ||
"693", | ||
"655", | ||
"700", | ||
"653" | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.