{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/5890","repository_url":"https://api.github.com/repos/influxdata/influxdb","labels_url":"https://api.github.com/repos/influxdata/influxdb/issues/5890/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/5890/comments","events_url":"https://api.github.com/repos/influxdata/influxdb/issues/5890/events","html_url":"https://github.com/influxdata/influxdb/issues/5890","id":138008881,"number":5890,"title":"[0.11] FIRST(),LAST() no longer return the relevant timestamp and values seem off","user":{"login":"rkuchan","id":8750814,"avatar_url":"https://avatars.githubusercontent.com/u/8750814?v=3","gravatar_id":"","url":"https://api.github.com/users/rkuchan","html_url":"https://github.com/rkuchan","followers_url":"https://api.github.com/users/rkuchan/followers","following_url":"https://api.github.com/users/rkuchan/following{/other_user}","gists_url":"https://api.github.com/users/rkuchan/gists{/gist_id}","starred_url":"https://api.github.com/users/rkuchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkuchan/subscriptions","organizations_url":"https://api.github.com/users/rkuchan/orgs","repos_url":"https://api.github.com/users/rkuchan/repos","events_url":"https://api.github.com/users/rkuchan/events{/privacy}","received_events_url":"https://api.github.com/users/rkuchan/received_events","type":"User","site_admin":false},"labels":[{"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},"milestone":{"url":"https://api.github.com/repos/influxdata/influxdb/milestones/46","html_url":"https://github.com/influxdata/influxdb/milestones/0.11.0","labels_url":"https://api.github.com/repos/influxdata/influxdb/milestones/46/labels","id":1559540,"number":46,"title":"0.11.0","description":"","creator":{"login":"jwilder","id":219935,"avatar_url":"https://avatars.githubusercontent.com/u/219935?v=3","gravatar_id":"","url":"https://api.github.com/users/jwilder","html_url":"https://github.com/jwilder","followers_url":"https://api.github.com/users/jwilder/followers","following_url":"https://api.github.com/users/jwilder/following{/other_user}","gists_url":"https://api.github.com/users/jwilder/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilder/subscriptions","organizations_url":"https://api.github.com/users/jwilder/orgs","repos_url":"https://api.github.com/users/jwilder/repos","events_url":"https://api.github.com/users/jwilder/events{/privacy}","received_events_url":"https://api.github.com/users/jwilder/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":138,"state":"closed","created_at":"2016-02-02T20:50:35Z","updated_at":"2016-04-27T18:12:35Z","due_on":"2016-03-22T06:00:00Z","closed_at":"2016-03-23T16:43:24Z"},"comments":6,"created_at":"2016-03-02T22:17:29Z","updated_at":"2016-04-27T18:12:35Z","closed_at":null,"body":"Using the [sample data](https://docs.influxdata.com/influxdb/v0.10/sample_data/data_download/) from the docs:\r\n* `first()` and `last()` no longer return the relevant timestamp in 0.11\r\n* `first()` and `last()` don't return the same point in 0.10 and 0.11\r\n\r\n**0.10**\r\n```\r\n> SELECT FIRST(water_level) FROM h2o_feet WHERE location = 'santa_monica'\r\nname: h2o_feet\r\n--------------\r\ntime\t\t\t        first\r\n2015-08-18T00:00:00Z\t2.064\r\n> SELECT LAST(water_level) FROM h2o_feet WHERE location = 'santa_monica'\r\nname: h2o_feet\r\n--------------\r\ntime\t\t\t         last\r\n2015-09-18T21:42:00Z\t 4.938\r\n```\r\n\r\n**0.11**\r\n```\r\n> SELECT FIRST(water_level) FROM h2o_feet WHERE location = 'santa_monica'\r\nname: h2o_feet\r\n--------------\r\ntime\t\t\t        first\r\n1970-01-01T00:00:00Z\t5.597\r\n> SELECT LAST(water_level) FROM h2o_feet WHERE location = 'santa_monica'\r\nname: h2o_feet\r\n--------------\r\ntime\t\t\t        last\r\n1970-01-01T00:00:00Z\t5.745\r\n```\r\n\r\nI believe 0.10 has the right answer:\r\n```\r\n#First values of water_level\r\n\r\n> SELECT water_level FROM h2o_feet WHERE location = 'santa_monica' LIMIT 3\r\nname: h2o_feet\r\n--------------\r\ntime\t\t\t        water_level\r\n2015-08-18T00:00:00Z\t2.064\r\n2015-08-18T00:06:00Z\t2.116\r\n2015-08-18T00:12:00Z\t2.028\r\n\r\n# Last values of water_level\r\n\r\n> SELECT water_level FROM h2o_feet WHERE location = 'santa_monica' ORDER BY time DESC LIMIT 3\r\nname: h2o_feet\r\n--------------\r\ntime\t\t\t        water_level\r\n2015-09-18T21:42:00Z\t4.938\r\n2015-09-18T21:36:00Z\t5.066\r\n2015-09-18T21:30:00Z\t5.01\r\n```\r\n\r\nI've tried to reproduce the 'getting the wrong point' issue in another data set and I can't!\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/comments/215177622","html_url":"https://github.com/influxdata/influxdb/issues/5890#issuecomment-215177622","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/5890","id":215177622,"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},"created_at":"2016-04-27T18:12:35Z","updated_at":"2016-04-27T18:12:35Z","body":"This has come back in 0.12:\r\n\r\n```\r\nConnected to http://localhost:8086 version 0.12.1\r\nInfluxDB shell 0.12.1\r\n> use telegraf\r\nUsing database telegraf\r\n> select last(usage_user) from cpu\r\nname: cpu\r\n---------\r\ntime\tlast\r\n0\t1.2096774193903288\r\n\r\n> \r\n```"}}