1

我无法从BigQuery.

我正在使用以下查询:

SELECT repository_name, actor_attributes_company, payload_ref_type, payload_action, type, created_at FROM githubarchive:github.timeline WHERE repository_organization = 'foo' and created_at > '2014-07-01'

一切都很好。现在,看起来 githubarchive:github.timeline 表不再可用。我一直在环顾四周,发现了另一张桌子:

SELECT repository_name, actor_attributes_company, payload_ref_type, payload_action, type, created_at FROM publicdata:samples.github_timeline WHERE repository_organization = 'foo' and created_at > '2014-07-01'

此查询有效,但返回零行。当我删除 created_at 限制时,它起作用了,但只返回了 2012 年的几行,所以看起来这只是示例数据。

有谁知道如何从 GitHub 中提取实时时间线数据?

4

2 回答 2

2

确实,publicdata:samples.github_timeline只有样本数据。

有关真正的 GitHub 存档文档,请查看http://www.githubarchive.org/

我昨天写了一篇关于查询它的文章:

示例查询:

SELECT repo.name,
       JSON_EXTRACT_SCALAR(payload, '$.action') action,
       COUNT(*) c,
FROM [githubarchive:month.201606]
WHERE type IN ('IssuesEvent')
AND repo.name IN ('kubernetes/kubernetes', 'docker/docker', 'tensorflow/tensorflow')
GROUP BY 1,2
ORDER BY 2 DESC

正如 Mikhail 指出的,还有另一个包含所有 GitHub 代码的数据集:

于 2016-07-20T04:00:45.710 回答
0

查看 githubarchive BigQuery 项目
它具有三个数据集:日、月、年,分别具有日、月和年数据

查看https://cloudplatform.googleblog.com/2016/06/GitHub-on-BigQuery-analyze-all-the-open-source-code.html了解更多详情

于 2016-07-19T19:10:15.870 回答