{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/1360","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/1360/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/1360/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/1360/events","html_url":"https://github.com/hadley/dplyr/issues/1360","id":103730407,"number":1360,"title":"distinct is not working with SQL","user":{"login":"ignacio82","id":1833309,"avatar_url":"https://avatars.githubusercontent.com/u/1833309?v=3","gravatar_id":"","url":"https://api.github.com/users/ignacio82","html_url":"https://github.com/ignacio82","followers_url":"https://api.github.com/users/ignacio82/followers","following_url":"https://api.github.com/users/ignacio82/following{/other_user}","gists_url":"https://api.github.com/users/ignacio82/gists{/gist_id}","starred_url":"https://api.github.com/users/ignacio82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ignacio82/subscriptions","organizations_url":"https://api.github.com/users/ignacio82/orgs","repos_url":"https://api.github.com/users/ignacio82/repos","events_url":"https://api.github.com/users/ignacio82/events{/privacy}","received_events_url":"https://api.github.com/users/ignacio82/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-28T14:38:45Z","updated_at":"2015-11-25T01:22:01Z","closed_at":"2015-09-01T12:20:22Z","body":"I'm not sure if this is a bug or if I'm doing something wrong.\r\n\r\n    # get sample databases from: http://chinookdatabase.codeplex.com/\r\n    library(dplyr)\r\n    mydb <- src_sqlite(\"Chinook_Sqlite.sqlite\")\r\n    Album <- tbl(mydb, \"Album\") \r\n    ArtistIds <- Album  %>% select(ArtistId)  %>% distinct(ArtistId)  %>% collect()\r\n\r\n    Error: Can't calculate distinct only on specified columns with SQL\r\n\r\nI initially posted the question on [stackoverflow](http://stackoverflow.com/questions/32272865/cant-calculate-distinct-only-on-specified-columns-with-sql?noredirect=1#comment52425847_32272865), but I'm starting to think this could be a bug.\r\n\r\nThanks for the help!"},"comment":{"url":"https://api.github.com/repos/hadley/dplyr/issues/comments/159456299","html_url":"https://github.com/hadley/dplyr/issues/1360#issuecomment-159456299","issue_url":"https://api.github.com/repos/hadley/dplyr/issues/1360","id":159456299,"user":{"login":"joelgombin","id":1918735,"avatar_url":"https://avatars.githubusercontent.com/u/1918735?v=3","gravatar_id":"","url":"https://api.github.com/users/joelgombin","html_url":"https://github.com/joelgombin","followers_url":"https://api.github.com/users/joelgombin/followers","following_url":"https://api.github.com/users/joelgombin/following{/other_user}","gists_url":"https://api.github.com/users/joelgombin/gists{/gist_id}","starred_url":"https://api.github.com/users/joelgombin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelgombin/subscriptions","organizations_url":"https://api.github.com/users/joelgombin/orgs","repos_url":"https://api.github.com/users/joelgombin/repos","events_url":"https://api.github.com/users/joelgombin/events{/privacy}","received_events_url":"https://api.github.com/users/joelgombin/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T01:22:01Z","updated_at":"2015-11-25T01:22:01Z","body":"Sorry but I don't understand how this is not a bug. You may want to select distinct lines with regard to one variable while retaining other columns. This works for `tbl_df` but does not with `tbl_sql`. If it is not possible to replicate this behaviour in SQL, at least it should be documented, shouldn't it?"}}