[Distutils] Publicly Queryable Statistics
Wes Turner
wes.turner at gmail.com
Sun May 22 15:52:06 EDT 2016
thanks!
On Sunday, May 22, 2016, Donald Stufft <donald at stufft.io> wrote:
>
> On May 22, 2016, at 3:39 AM, Wes Turner <wes.turner at gmail.com
> <javascript:_e(%7B%7D,'cvml','wes.turner at gmail.com');>> wrote:
>
> - to query, say, a month's worth of data, what would need to be done?
> - "sharded by day" ... UTC?
>
>
>
> You use a TABLE_DATE_RANGE() function, like this:
>
>
> TABLE_DATE_RANGE([the-psf:pypi.downloads], TIMESTAMP("20160114"),
> TIMESTAMP("20160214”))
>
> Or, if you wanted to get fancier you could do something like this for the
> “last 30 days”:
>
> TABLE_DATE_RANGE([the-psf:pypi.downloads],
> DATE_ADD(CURRENT_TIMESTAMP(), -1, "month"), CURRENT_TIMESTAMP())
>
>
> You can see examples of it in use at
> https://gist.github.com/alex/4f100a9592b05e9b4d63 or see the query docs
> at https://cloud.google.com/bigquery/query-reference.
>
>
> —
> Donald Stufft
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20160522/9d51f558/attachment.html>
More information about the Distutils-SIG
mailing list