# Analyzing GitHub Pull Request Data with BigQuery

DevFeed: [Analyzing GitHub Pull Request Data with BigQuery](<https://devfeed.tech/articles/analyzing-github-pull-request-data-with-bigquery-35147.md>)

Original publisher: [Read original article](<https://blog.jessfraz.com/post/analyzing-github-pull-request-data-with-big-query/>)

Published: 2016-08-07T15:09:26Z

Content type: article

Language: en

Sources: [Jessie Frazelle](<https://devfeed.tech/sources/jessie-frazelle.md>)

Topics: [BigQuery](<https://devfeed.tech/topics/bigquery.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [data](<https://devfeed.tech/topics/data.md>), [dataset](<https://devfeed.tech/topics/dataset.md>)

Tags: [bigquery](<https://devfeed.tech/tags/bigquery.md>), [data](<https://devfeed.tech/tags/data.md>), [dataset](<https://devfeed.tech/tags/dataset.md>), [github](<https://devfeed.tech/tags/github.md>), [github-issues](<https://devfeed.tech/tags/github-issues.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>)

## AI overview

This article uses BigQuery and the GitHub Archive dataset to analyze pull requests from 2015 across prominent repositories. It examines pull-request volume, author counts, merge-versus-close outcomes, merge ratios, and diff sizes, concluding from the analyzed data that smaller pull requests were more likely to be merged.

## Source excerpt

I really enjoyed Felipe Hoffa's post on Analyzing GitHub issues and comments with BigQuery . Which got me wondering about my favorite subject ever, The Art of Closing. I wonder what the stats are for the top 15 projects on GitHub in terms of pull requests opened vs. pull requests closed. This post will use the GitHub Archive dataset. Top 15 repositories with the most pull requests First let's find the top 15 repos with the most pull requests from 2015. Let's make sure to check the payload action is "opened". SELECT repo.name, COUNT(*) c FROM [githubarchive:year.2015] WHERE type IN ( 'PullRequestEvent') AND JSON_EXTRACT(payload, '$.action') IN ('"opened"') GROUP BY repo.name ORDER BY c DESC LIMIT 15 repo_name c openmicroscopy/snoopys-sandbox 11656 brianchandotcom/liferay-portal 10803 Homebrew/homebrew 9519 caskroom/homebrew-cask 6833 apache/spark 6667 saltstack/salt 6636 mozilla-b2g/gaia 6609 jlord/patchwork 6155 GoogleCloudPlatform/kubernetes 5937 jsdelivr/jsdelivr 5747 rust-lang/rust 5559 cms-sw/cmssw 5507 code-dot-org/code-dot-org 5267 docker/docker 5083 NixOS/nixpkgs 4873 Okay that's a lot of pull requests. Let's find the projects will the most unique number of pull request authors. SELECT repo.name, COUNT(*) c, COUNT(DISTINCT actor.id) authors, FROM [githubarchive:year.2015] WHERE type IN ( 'PullRequestEvent') AND JSON_EXTRACT(payload, '$.action') IN ('"opened"') GROUP BY repo.name ORDER BY authors DESC LIMIT 15 repo_name c authors jlord/patchwork 6155 5396 octocat/Spoon-Knife 3966 3741 deadlyvipers/dojo_rules 4847 3076 Homebrew/homebrew 9519 2186 udacity/create-your-own-adventure 2709 2167 caskroom/homebrew-cask 6833 1517 borisyankov/DefinitelyTyped 2694 1127 rails/rails 3100 1012 LarryMad/recipes 1086 989 laravel/framework 2736 891 docker/docker 5083 882 rdpeng/ProgrammingAssignment2 922 866 apache/spark 6667 851 JetBrains/swot 951 836 rust-lang/rust 5559 835 Now let's see what the merge vs. close numbers look like for those projects. SELECT repo.name, COUNT(*