Status Update
Comments
th...@google.com <th...@google.com> #2
Thanks for the feature request! I've added this to our internal FR tracker.
el...@google.com <el...@google.com> #3
We won't be improving support for this in legacy SQL, but keep an eye out for support in standard SQL (https://code.google.com/p/google-bigquery/issues/detail?id=827 ), which would let you use a timestamp string of arbitrary precision, e.g. '2017-02-07 12:34:56'.
Description
Suggestion 1: Accept "humanized" measures, like "-1d" (one day ago), "-4h" (4 hours ago), "-5m" (5 minutes ago).
Suggestion 2: Adopt a better "slice" notation. To query against the last hour of data, the decorator must look something like [mytable@-3600000--1]. The way the '-' token is overloaded is a bit confusing, and '-1' feels like a weird hack to express "...up to now" (maybe there's a better way).
Something more similar to python's slice syntax would be a bit more natural / easier to explain and remember:
[mytable@-2d,-1d] // data added between 2 days ago and 1 day ago.
[mytable@,-1w] // data added up to a week ago
[mytable@-3d,] // data added in last 1 day
Ref:
cheers,
mikey