{"action":"closed","number":910,"pull_request":{"url":"https://api.github.com/repos/getquill/quill/pulls/910","id":142671395,"html_url":"https://github.com/getquill/quill/pull/910","diff_url":"https://github.com/getquill/quill/pull/910.diff","patch_url":"https://github.com/getquill/quill/pull/910.patch","issue_url":"https://api.github.com/repos/getquill/quill/issues/910","number":910,"state":"closed","locked":false,"title":"don't expand nested queries that use","user":{"login":"fwbrasil","id":831175,"avatar_url":"https://avatars0.githubusercontent.com/u/831175?v=4","gravatar_id":"","url":"https://api.github.com/users/fwbrasil","html_url":"https://github.com/fwbrasil","followers_url":"https://api.github.com/users/fwbrasil/followers","following_url":"https://api.github.com/users/fwbrasil/following{/other_user}","gists_url":"https://api.github.com/users/fwbrasil/gists{/gist_id}","starred_url":"https://api.github.com/users/fwbrasil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fwbrasil/subscriptions","organizations_url":"https://api.github.com/users/fwbrasil/orgs","repos_url":"https://api.github.com/users/fwbrasil/repos","events_url":"https://api.github.com/users/fwbrasil/events{/privacy}","received_events_url":"https://api.github.com/users/fwbrasil/received_events","type":"User","site_admin":false},"body":"Fixes #724 \r\n\r\n### Problem\r\n\r\n`ExpandNestedQueries` tries to expand nested queries that have a `DISTINCT` clause. It doesn't make sense because it changes the meaning of t.he distinct operation. For instance:\r\n\r\n```scala\r\nqr1.distinct.nested.map(t => t.I) \r\n\r\n// is not semantic equal to the current normalized form:\r\n\r\nqr1.map(t => t.I).distinct.nested.map(t => t.I) \r\n\r\n// since `qr1` also has other columns that are considered by the distinct criteria.\r\n```\r\n\r\n### Solution\r\n\r\nDon't perform the expansion. There's still a potential problem of column name conflict if the nested distinct query selects from multiple tables. I think it's a reasonable tradeoff.\r\n\r\n### Checklist\r\n\r\n- [x] Unit test all changes\r\n- [x] Update `README.md` if applicable\r\n- [x] Add `[WIP]` to the pull request title if it's work in progress\r\n- [x] [Squash commits](https://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one) that aren't meaningful changes\r\n- [x] Run `sbt scalariformFormat test:scalariformFormat` to make sure that the source files are formatted\r\n\r\n@getquill/maintainers\r\n","created_at":"2017-09-22T21:16:53Z","updated_at":"2017-09-22T21:17:16Z","closed_at":"2017-09-22T21:17:16Z","merged_at":"2017-09-22T21:17:16Z","merge_commit_sha":"0463ae5ca770a5c64cc14610d767ad159bb561b2","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/getquill/quill/pulls/910/commits","review_comments_url":"https://api.github.com/repos/getquill/quill/pulls/910/comments","review_comment_url":"https://api.github.com/repos/getquill/quill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getquill/quill/issues/910/comments","statuses_url":"https://api.github.com/repos/getquill/quill/statuses/94b5187a5342d41ce5e3032138cd3665ef894777","head":{"label":"getquill:fix-724","ref":"fix-724","sha":"94b5187a5342d41ce5e3032138cd3665ef894777","user":{"login":"getquill","id":13422948,"avatar_url":"https://avatars3.githubusercontent.com/u/13422948?v=4","gravatar_id":"","url":"https://api.github.com/users/getquill","html_url":"https://github.com/getquill","followers_url":"https://api.github.com/users/getquill/followers","following_url":"https://api.github.com/users/getquill/following{/other_user}","gists_url":"https://api.github.com/users/getquill/gists{/gist_id}","starred_url":"https://api.github.com/users/getquill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getquill/subscriptions","organizations_url":"https://api.github.com/users/getquill/orgs","repos_url":"https://api.github.com/users/getquill/repos","events_url":"https://api.github.com/users/getquill/events{/privacy}","received_events_url":"https://api.github.com/users/getquill/received_events","type":"Organization","site_admin":false},"repo":{"id":39411044,"name":"quill","full_name":"getquill/quill","owner":{"login":"getquill","id":13422948,"avatar_url":"https://avatars3.githubusercontent.com/u/13422948?v=4","gravatar_id":"","url":"https://api.github.com/users/getquill","html_url":"https://github.com/getquill","followers_url":"https://api.github.com/users/getquill/followers","following_url":"https://api.github.com/users/getquill/following{/other_user}","gists_url":"https://api.github.com/users/getquill/gists{/gist_id}","starred_url":"https://api.github.com/users/getquill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getquill/subscriptions","organizations_url":"https://api.github.com/users/getquill/orgs","repos_url":"https://api.github.com/users/getquill/repos","events_url":"https://api.github.com/users/getquill/events{/privacy}","received_events_url":"https://api.github.com/users/getquill/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getquill/quill","description":"Compile-time Language Integrated Queries for Scala","fork":false,"url":"https://api.github.com/repos/getquill/quill","forks_url":"https://api.github.com/repos/getquill/quill/forks","keys_url":"https://api.github.com/repos/getquill/quill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getquill/quill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getquill/quill/teams","hooks_url":"https://api.github.com/repos/getquill/quill/hooks","issue_events_url":"https://api.github.com/repos/getquill/quill/issues/events{/number}","events_url":"https://api.github.com/repos/getquill/quill/events","assignees_url":"https://api.github.com/repos/getquill/quill/assignees{/user}","branches_url":"https://api.github.com/repos/getquill/quill/branches{/branch}","tags_url":"https://api.github.com/repos/getquill/quill/tags","blobs_url":"https://api.github.com/repos/getquill/quill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getquill/quill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getquill/quill/git/refs{/sha}","trees_url":"https://api.github.com/repos/getquill/quill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getquill/quill/statuses/{sha}","languages_url":"https://api.github.com/repos/getquill/quill/languages","stargazers_url":"https://api.github.com/repos/getquill/quill/stargazers","contributors_url":"https://api.github.com/repos/getquill/quill/contributors","subscribers_url":"https://api.github.com/repos/getquill/quill/subscribers","subscription_url":"https://api.github.com/repos/getquill/quill/subscription","commits_url":"https://api.github.com/repos/getquill/quill/commits{/sha}","git_commits_url":"https://api.github.com/repos/getquill/quill/git/commits{/sha}","comments_url":"https://api.github.com/repos/getquill/quill/comments{/number}","issue_comment_url":"https://api.github.com/repos/getquill/quill/issues/comments{/number}","contents_url":"https://api.github.com/repos/getquill/quill/contents/{+path}","compare_url":"https://api.github.com/repos/getquill/quill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getquill/quill/merges","archive_url":"https://api.github.com/repos/getquill/quill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getquill/quill/downloads","issues_url":"https://api.github.com/repos/getquill/quill/issues{/number}","pulls_url":"https://api.github.com/repos/getquill/quill/pulls{/number}","milestones_url":"https://api.github.com/repos/getquill/quill/milestones{/number}","notifications_url":"https://api.github.com/repos/getquill/quill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getquill/quill/labels{/name}","releases_url":"https://api.github.com/repos/getquill/quill/releases{/id}","deployments_url":"https://api.github.com/repos/getquill/quill/deployments","created_at":"2015-07-20T22:15:04Z","updated_at":"2017-09-22T15:08:05Z","pushed_at":"2017-09-22T21:17:16Z","git_url":"git://github.com/getquill/quill.git","ssh_url":"git@github.com:getquill/quill.git","clone_url":"https://github.com/getquill/quill.git","svn_url":"https://github.com/getquill/quill","homepage":"http://getquill.io","size":6349,"stargazers_count":974,"watchers_count":974,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":153,"mirror_url":null,"open_issues_count":120,"forks":153,"open_issues":120,"watchers":974,"default_branch":"master"}},"base":{"label":"getquill:master","ref":"master","sha":"5b117ef7c040f7814e83c77a801abf9f6630b9f0","user":{"login":"getquill","id":13422948,"avatar_url":"https://avatars3.githubusercontent.com/u/13422948?v=4","gravatar_id":"","url":"https://api.github.com/users/getquill","html_url":"https://github.com/getquill","followers_url":"https://api.github.com/users/getquill/followers","following_url":"https://api.github.com/users/getquill/following{/other_user}","gists_url":"https://api.github.com/users/getquill/gists{/gist_id}","starred_url":"https://api.github.com/users/getquill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getquill/subscriptions","organizations_url":"https://api.github.com/users/getquill/orgs","repos_url":"https://api.github.com/users/getquill/repos","events_url":"https://api.github.com/users/getquill/events{/privacy}","received_events_url":"https://api.github.com/users/getquill/received_events","type":"Organization","site_admin":false},"repo":{"id":39411044,"name":"quill","full_name":"getquill/quill","owner":{"login":"getquill","id":13422948,"avatar_url":"https://avatars3.githubusercontent.com/u/13422948?v=4","gravatar_id":"","url":"https://api.github.com/users/getquill","html_url":"https://github.com/getquill","followers_url":"https://api.github.com/users/getquill/followers","following_url":"https://api.github.com/users/getquill/following{/other_user}","gists_url":"https://api.github.com/users/getquill/gists{/gist_id}","starred_url":"https://api.github.com/users/getquill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getquill/subscriptions","organizations_url":"https://api.github.com/users/getquill/orgs","repos_url":"https://api.github.com/users/getquill/repos","events_url":"https://api.github.com/users/getquill/events{/privacy}","received_events_url":"https://api.github.com/users/getquill/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getquill/quill","description":"Compile-time Language Integrated Queries for Scala","fork":false,"url":"https://api.github.com/repos/getquill/quill","forks_url":"https://api.github.com/repos/getquill/quill/forks","keys_url":"https://api.github.com/repos/getquill/quill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getquill/quill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getquill/quill/teams","hooks_url":"https://api.github.com/repos/getquill/quill/hooks","issue_events_url":"https://api.github.com/repos/getquill/quill/issues/events{/number}","events_url":"https://api.github.com/repos/getquill/quill/events","assignees_url":"https://api.github.com/repos/getquill/quill/assignees{/user}","branches_url":"https://api.github.com/repos/getquill/quill/branches{/branch}","tags_url":"https://api.github.com/repos/getquill/quill/tags","blobs_url":"https://api.github.com/repos/getquill/quill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getquill/quill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getquill/quill/git/refs{/sha}","trees_url":"https://api.github.com/repos/getquill/quill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getquill/quill/statuses/{sha}","languages_url":"https://api.github.com/repos/getquill/quill/languages","stargazers_url":"https://api.github.com/repos/getquill/quill/stargazers","contributors_url":"https://api.github.com/repos/getquill/quill/contributors","subscribers_url":"https://api.github.com/repos/getquill/quill/subscribers","subscription_url":"https://api.github.com/repos/getquill/quill/subscription","commits_url":"https://api.github.com/repos/getquill/quill/commits{/sha}","git_commits_url":"https://api.github.com/repos/getquill/quill/git/commits{/sha}","comments_url":"https://api.github.com/repos/getquill/quill/comments{/number}","issue_comment_url":"https://api.github.com/repos/getquill/quill/issues/comments{/number}","contents_url":"https://api.github.com/repos/getquill/quill/contents/{+path}","compare_url":"https://api.github.com/repos/getquill/quill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getquill/quill/merges","archive_url":"https://api.github.com/repos/getquill/quill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getquill/quill/downloads","issues_url":"https://api.github.com/repos/getquill/quill/issues{/number}","pulls_url":"https://api.github.com/repos/getquill/quill/pulls{/number}","milestones_url":"https://api.github.com/repos/getquill/quill/milestones{/number}","notifications_url":"https://api.github.com/repos/getquill/quill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getquill/quill/labels{/name}","releases_url":"https://api.github.com/repos/getquill/quill/releases{/id}","deployments_url":"https://api.github.com/repos/getquill/quill/deployments","created_at":"2015-07-20T22:15:04Z","updated_at":"2017-09-22T15:08:05Z","pushed_at":"2017-09-22T21:17:16Z","git_url":"git://github.com/getquill/quill.git","ssh_url":"git@github.com:getquill/quill.git","clone_url":"https://github.com/getquill/quill.git","svn_url":"https://github.com/getquill/quill","homepage":"http://getquill.io","size":6349,"stargazers_count":974,"watchers_count":974,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":153,"mirror_url":null,"open_issues_count":120,"forks":153,"open_issues":120,"watchers":974,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getquill/quill/pulls/910"},"html":{"href":"https://github.com/getquill/quill/pull/910"},"issue":{"href":"https://api.github.com/repos/getquill/quill/issues/910"},"comments":{"href":"https://api.github.com/repos/getquill/quill/issues/910/comments"},"review_comments":{"href":"https://api.github.com/repos/getquill/quill/pulls/910/comments"},"review_comment":{"href":"https://api.github.com/repos/getquill/quill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getquill/quill/pulls/910/commits"},"statuses":{"href":"https://api.github.com/repos/getquill/quill/statuses/94b5187a5342d41ce5e3032138cd3665ef894777"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"fwbrasil","id":831175,"avatar_url":"https://avatars0.githubusercontent.com/u/831175?v=4","gravatar_id":"","url":"https://api.github.com/users/fwbrasil","html_url":"https://github.com/fwbrasil","followers_url":"https://api.github.com/users/fwbrasil/followers","following_url":"https://api.github.com/users/fwbrasil/following{/other_user}","gists_url":"https://api.github.com/users/fwbrasil/gists{/gist_id}","starred_url":"https://api.github.com/users/fwbrasil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fwbrasil/subscriptions","organizations_url":"https://api.github.com/users/fwbrasil/orgs","repos_url":"https://api.github.com/users/fwbrasil/repos","events_url":"https://api.github.com/users/fwbrasil/events{/privacy}","received_events_url":"https://api.github.com/users/fwbrasil/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":21,"deletions":4,"changed_files":4}}
{"actor":{"display_login":"fwbrasil"}}