{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/6878","repository_url":"https://api.github.com/repos/influxdata/influxdb","labels_url":"https://api.github.com/repos/influxdata/influxdb/issues/6878/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/6878/comments","events_url":"https://api.github.com/repos/influxdata/influxdb/issues/6878/events","html_url":"https://github.com/influxdata/influxdb/issues/6878","id":161238577,"number":6878,"title":"fill(previous) should find most recent value, even if outside query time range","user":{"login":"beckettsean","id":6537329,"avatar_url":"https://avatars.githubusercontent.com/u/6537329?v=3","gravatar_id":"","url":"https://api.github.com/users/beckettsean","html_url":"https://github.com/beckettsean","followers_url":"https://api.github.com/users/beckettsean/followers","following_url":"https://api.github.com/users/beckettsean/following{/other_user}","gists_url":"https://api.github.com/users/beckettsean/gists{/gist_id}","starred_url":"https://api.github.com/users/beckettsean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckettsean/subscriptions","organizations_url":"https://api.github.com/users/beckettsean/orgs","repos_url":"https://api.github.com/users/beckettsean/repos","events_url":"https://api.github.com/users/beckettsean/events{/privacy}","received_events_url":"https://api.github.com/users/beckettsean/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/influxdata/influxdb/labels/category/feature%20request","name":"category/feature request","color":"006b75"},{"url":"https://api.github.com/repos/influxdata/influxdb/labels/category/queries","name":"category/queries","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"jsternberg","id":1212129,"avatar_url":"https://avatars.githubusercontent.com/u/1212129?v=3","gravatar_id":"","url":"https://api.github.com/users/jsternberg","html_url":"https://github.com/jsternberg","followers_url":"https://api.github.com/users/jsternberg/followers","following_url":"https://api.github.com/users/jsternberg/following{/other_user}","gists_url":"https://api.github.com/users/jsternberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsternberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsternberg/subscriptions","organizations_url":"https://api.github.com/users/jsternberg/orgs","repos_url":"https://api.github.com/users/jsternberg/repos","events_url":"https://api.github.com/users/jsternberg/events{/privacy}","received_events_url":"https://api.github.com/users/jsternberg/received_events","type":"User","site_admin":false},"assignees":[{"login":"jsternberg","id":1212129,"avatar_url":"https://avatars.githubusercontent.com/u/1212129?v=3","gravatar_id":"","url":"https://api.github.com/users/jsternberg","html_url":"https://github.com/jsternberg","followers_url":"https://api.github.com/users/jsternberg/followers","following_url":"https://api.github.com/users/jsternberg/following{/other_user}","gists_url":"https://api.github.com/users/jsternberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsternberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsternberg/subscriptions","organizations_url":"https://api.github.com/users/jsternberg/orgs","repos_url":"https://api.github.com/users/jsternberg/repos","events_url":"https://api.github.com/users/jsternberg/events{/privacy}","received_events_url":"https://api.github.com/users/jsternberg/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-06-20T16:33:24Z","updated_at":"2016-07-06T18:58:18Z","closed_at":null,"body":"### Feature Request\r\n\r\n__Proposal:__ [Description of the feature]\r\n\r\nWhen executing `fill(previous)` the query should always have a value for `previous`, even if there is no point with that field in the query time range.\r\n\r\n__Current behavior:__ [What currently happens]\r\n\r\n```\r\n> select * from fp\r\nname: fp\r\n--------\r\ntime\t\t\tvalue\r\n2016-06-20T16:09:13Z\t10\r\n2016-06-20T16:19:13Z\t100\r\n\r\n> select max(value) from fp where time > now() - 20m group by time(5m) fill(previous)\r\nname: fp\r\n--------\r\ntime\t\t\tmax\r\n2016-06-20T16:05:00Z\t10\r\n2016-06-20T16:10:00Z\t10\r\n2016-06-20T16:15:00Z\t100\r\n2016-06-20T16:20:00Z\t100\r\n2016-06-20T16:25:00Z\t100\r\n\r\n> select max(value) from fp where time > now() - 18m group by time(5m) fill(previous)\r\nname: fp\r\n--------\r\ntime\t\t\tmax\r\n2016-06-20T16:10:00Z\t\r\n2016-06-20T16:15:00Z\t100\r\n2016-06-20T16:20:00Z\t100\r\n2016-06-20T16:25:00Z\t100\r\n```\r\n\r\nNote the null value for the 16:10-16:15 bucket, despite there being a point at 16:09 with a value.\r\n\r\n__Desired behavior:__ [What you would like to happen]\r\n```\r\n> select * from fp\r\nname: fp\r\n--------\r\ntime\t\t\tvalue\r\n2016-06-20T16:09:13Z\t10\r\n2016-06-20T16:19:13Z\t100\r\n\r\n> select max(value) from fp where time > now() - 20m group by time(5m) fill(previous)\r\nname: fp\r\n--------\r\ntime\t\t\tmax\r\n2016-06-20T16:05:00Z\t10\r\n2016-06-20T16:10:00Z\t10\r\n2016-06-20T16:15:00Z\t100\r\n2016-06-20T16:20:00Z\t100\r\n2016-06-20T16:25:00Z\t100\r\n\r\n> select max(value) from fp where time > now() - 18m group by time(5m) fill(previous)\r\nname: fp\r\n--------\r\ntime\t\t\tmax\r\n2016-06-20T16:10:00Z\t10\r\n2016-06-20T16:15:00Z\t100\r\n2016-06-20T16:20:00Z\t100\r\n2016-06-20T16:25:00Z\t100\r\n```\r\n\r\n__Use case:__ [Why is this important (helps with prioritizing requests)]\r\n\r\nCurrently customers have to know when the last value was recorded in order to make sure that point is included in the time range. For irregular series that's a significant burden. If the system can always find the most recent value regardless of the lower time bound, then many state change queries become useful."},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/comments/230870793","html_url":"https://github.com/influxdata/influxdb/issues/6878#issuecomment-230870793","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/6878","id":230870793,"user":{"login":"jwheeler-gs","id":20070466,"avatar_url":"https://avatars.githubusercontent.com/u/20070466?v=3","gravatar_id":"","url":"https://api.github.com/users/jwheeler-gs","html_url":"https://github.com/jwheeler-gs","followers_url":"https://api.github.com/users/jwheeler-gs/followers","following_url":"https://api.github.com/users/jwheeler-gs/following{/other_user}","gists_url":"https://api.github.com/users/jwheeler-gs/gists{/gist_id}","starred_url":"https://api.github.com/users/jwheeler-gs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwheeler-gs/subscriptions","organizations_url":"https://api.github.com/users/jwheeler-gs/orgs","repos_url":"https://api.github.com/users/jwheeler-gs/repos","events_url":"https://api.github.com/users/jwheeler-gs/events{/privacy}","received_events_url":"https://api.github.com/users/jwheeler-gs/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T18:58:18Z","updated_at":"2016-07-06T18:58:18Z","body":"Aaah, I get it now. That's actually going to be a possible case for my use as well. I'd expect (hope for) fill to return that previous value for the entire interval. But then again, I'd also expect it to not return any data past the current point in time.\r\n\r\nI'm using fill to provide data directly to a chart which can be adjusted to show any time window, past, present, or even future (where future data is filled in using prediction data from another dataset). What I really want is to see the previous value up to some specified point (the present timestamp) and then no data past that. This is probably a bit much to ask of influx and is outside the scope of what it really needs to provide. That can still be handled easily enough on the receiving end by nulling out all values past the current timestamp."}}
{"actor":{"display_login":"jwheeler-gs"}}