{"action":"closed","issue":{"url":"https://api.github.com/repos/druid-io/druid/issues/1887","labels_url":"https://api.github.com/repos/druid-io/druid/issues/1887/labels{/name}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/1887/comments","events_url":"https://api.github.com/repos/druid-io/druid/issues/1887/events","html_url":"https://github.com/druid-io/druid/issues/1887","id":113959264,"number":1887,"title":"Ability to express IN filter as a filter","user":{"login":"vogievetsky","id":177816,"avatar_url":"https://avatars.githubusercontent.com/u/177816?v=3","gravatar_id":"","url":"https://api.github.com/users/vogievetsky","html_url":"https://github.com/vogievetsky","followers_url":"https://api.github.com/users/vogievetsky/followers","following_url":"https://api.github.com/users/vogievetsky/following{/other_user}","gists_url":"https://api.github.com/users/vogievetsky/gists{/gist_id}","starred_url":"https://api.github.com/users/vogievetsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vogievetsky/subscriptions","organizations_url":"https://api.github.com/users/vogievetsky/orgs","repos_url":"https://api.github.com/users/vogievetsky/repos","events_url":"https://api.github.com/users/vogievetsky/events{/privacy}","received_events_url":"https://api.github.com/users/vogievetsky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/druid-io/druid/labels/Difficulty%20-%20Easy","name":"Difficulty - Easy","color":"207de5"},{"url":"https://api.github.com/repos/druid-io/druid/labels/Feature","name":"Feature","color":"2ceefb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T01:20:25Z","updated_at":"2015-11-06T22:47:48Z","closed_at":"2015-11-06T22:47:48Z","body":"This is part of Plywood/PlyQL and is currently being done using an OR of selectors\r\n\r\n```sql\r\nSELECT COUNT(*) AS 'Count' FROM `wikipedia` WHERE `outlaw` IN ('Good', 'Bad', 'Ugly')\r\n```\r\n\r\nI would like to express this:\r\n\r\n```json\r\n{\r\n  \"type\": \"or\",\r\n  \"fields\": [\r\n    {\r\n      \"dimension\": \"outlaw\",\r\n      \"type\": \"selector\",\r\n      \"value\": \"Good\",\r\n    },\r\n    {\r\n      \"dimension\": \"outlaw\",\r\n      \"type\": \"selector\",\r\n      \"value\": \"Bad\",\r\n    },\r\n    {\r\n      \"dimension\": \"outlaw\",\r\n      \"type\": \"selector\",\r\n      \"value\": \"Ugly\",\r\n    }\r\n  ] \r\n}\r\n```\r\n\r\nas\r\n\r\n```json\r\n{\r\n  \"type\": \"in\",\r\n  \"dimension\": \"outlaw\",\r\n  \"values\": [\"Good\", \"Bad\", \"Ugly\"]  \r\n}\r\n```\r\n\r\nI realize that this will have almost no performance improvement, this is basically syntax sugar but every DB on earth supports IN filters since they are **such** a common use case. I bet 80% of the Druid user base searched the docs for how to make an IN filter and then sighed when they saw what you actually have to do.\r\n\r\nAlso this saves bytes for large IN filters :-p"}}