{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/5886","repository_url":"https://api.github.com/repos/influxdata/influxdb","labels_url":"https://api.github.com/repos/influxdata/influxdb/issues/5886/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/5886/comments","events_url":"https://api.github.com/repos/influxdata/influxdb/issues/5886/events","html_url":"https://github.com/influxdata/influxdb/issues/5886","id":137944307,"number":5886,"title":"[0.11] Nesting DISTINCT() in COUNT() with string field values returns an error (unlike 0.10)","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":15,"closed_issues":89,"state":"open","created_at":"2016-02-02T20:50:35Z","updated_at":"2016-03-02T22:17:38Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-03-02T17:49:48Z","updated_at":"2016-03-02T22:24:39Z","closed_at":null,"body":"When my field values are floats, nesting `DISTINCT()` in `COUNT()` works:\r\n```\r\n> SELECT mynum FROM mymeas\r\nname: mymeas\r\n------------\r\ntime\t\t\t\t            mynum\r\n2016-03-02T17:43:18.978582468Z\t1\r\n2016-03-02T17:43:21.08920201Z\t1\r\n2016-03-02T17:43:22.7130337Z\t3\r\n2016-03-02T17:43:23.984634459Z\t4\r\n\r\n> SELECT COUNT(DISTINCT(mynum)) FROM mymeas\r\nname: mymeas\r\n------------\r\ntime\t\t\t        count\r\n1970-01-01T00:00:00Z\t3\r\n```\r\nWhen my field values are strings, nesting `DISTINCT()` in `COUNT()` returns an error:\r\n```\r\n> SELECT mystring FROM mymeas\r\nname: mymeas\r\n------------\r\ntime\t\t\t\t            mystring\r\n2016-03-02T17:39:05.162187294Z\tand miles\r\n2016-03-02T17:39:13.256191Z\t    to go before\r\n2016-03-02T17:39:22.407710146Z\ti sleep\r\n2016-03-02T17:39:28.023493995Z\tand miles\r\n\r\n> SELECT COUNT(DISTINCT(mystring)) FROM mymeas\r\nERR: unsupported count iterator type: *influxql.stringReduceSliceIterator\r\n```\r\nThis last query doesn't return an error in 0.10."},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/comments/191461624","html_url":"https://github.com/influxdata/influxdb/issues/5886#issuecomment-191461624","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/5886","id":191461624,"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},"created_at":"2016-03-02T22:24:39Z","updated_at":"2016-03-02T22:24:39Z","body":"Confirming that I get similar errors with `first()` and `last()` in 0.11:\r\n```\r\n> SELECT first(\"level description\") from h2o_feet\r\nERR: unsupported first iterator type: *influxql.stringMergeIterator\r\n> SELECT last(\"level description\") from h2o_feet\r\nERR: unsupported last iterator type: *influxql.stringMergeIterator\r\n```"}}