3 ms·
Github Easter Egg hunt query: SELECT CONCAT("https://github.com/",repo_name,"/blob/master/",path) AS file_url, FROM [bigquery-public-data:g
by bduerst 10y ago
Github Easter Egg hunt query:
SELECT
CONCAT("https://github.com/",repo_name,"/blob/master/",path) AS file_url,
FROM
[bigquery-public-data:github_repos.files]
WHERE
id IN (SELECT id FROM [bigquery-public-data:github_repos.contents]
WHERE NOT binary AND LOWER(content) CONTAINS 'easter egg')
and path not like "%.csv"
GROUP BY 1
LIMIT 1000
36s elapsed, 1.79 TB (so not free). Using github_repos.sample_files and github_repos.sample_contents only costs 31 GB (free) but not as many easter eggs :)
- Goopplesoft 10y agoJust looked at their pricing. ~$9 query right there. https://cloud.google.com/bigquery/pricing https://cloud.google.com/bigquery/pricing
- bduerst 10y agoGood point. Here's the results if anyone wants them: https://raw.githubusercontent.com/bduerst/GithubEasterEgg/master/EasterEggs.csv https://raw.githubusercontent.com/bduerst/GithubEasterEgg/ma...
- boulos 10y agoOn my phone, but what if you limit 2000 inside the .contents query? (BigQuery should exit early and touch less data).
- minimaxir 10y agoChanging the return limit does nothing. Queries are charged on data searched.
- niutech 10y agoWhy do you use BigQuery when Github code search is free?