sql - Google BigQuery: how to find the repo owner's github username for all github repos that contain a string? -


i'm exploring cool github repos open dataset on bigquery, , hit query can image can't quite write.

curious, bigquery query return:

  • the github username
    • of author
      • of each github repo
        • with javascript file or html file
          • that contains string d3

?

here approximate answer, minus constraint file match should javascript or html file (have filename ends in .js or .html)

#standardsql create temp function reponameshaved3(reponames array<string>)   returns int64   language js """     return reponames.some(namehasd3) ? 1 : 0;      function namehasd3(name) {       var normalized = name.tolowercase();       return normalized.indexof('d3') === 0 ||         normalized.indexof('-d3') !== -1;     }   """; select author.name, repo_name `bigquery-public-data.github_repos.commits`   reponameshaved3(repo_name) = 1 -- limit 10 

credit @deathmtn on twitter query


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -