GitHub PullRequestReviewCommentEvent at 2014-08-22 15:31:16
Repository: crate
Actor: mfelsche
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/crate/crate/pulls/comments/16603842","id":16603842,"diff_hunk":"@@ -697,52 +697,90 @@ private void groupBy(SelectAnalysis analysis, Plan plan, Context context) {\n         }\n     }\n \n-    private boolean requiresDistribution(Routing routing) {\n+    private boolean requiresDistribution(SelectAnalysis analysis, Routing routing) {\n         if (!routing.hasLocations()) return false;\n+\n+        if (groupedByClusteredColumn(analysis)) return false;\n         if (routing.locations().size() > 1) return true;\n \n         String nodeId = routing.locations().keySet().iterator().next();\n         return !(nodeId == null || nodeId.equals(clusterService.localNode().id()));\n     }\n \n+    private boolean groupedByClusteredColumn(SelectAnalysis analysis) {\n+        List<Symbol> groupBy = analysis.groupBy();\n+        assert groupBy != null;\n+        int numRefs = 0;\n+        boolean groupedByClusteredByColumn = false;\n+        for (Symbol symbol : groupBy) {","path":"sql/src/main/java/io/crate/planner/Planner.java","position":29,"original_position":29,"commit_id":"24d014bdfb4c59a8d21c77144cc431f4dddf693a","original_commit_id":"24d014bdfb4c59a8d21c77144cc431f4dddf693a","user":{"login":"mfelsche","id":1152667,"avatar_url":"https://avatars.githubusercontent.com/u/1152667?v=2","gravatar_id":"277750e91307e098dadd422dc7766663","url":"https://api.github.com/users/mfelsche","html_url":"https://github.com/mfelsche","followers_url":"https://api.github.com/users/mfelsche/followers","following_url":"https://api.github.com/users/mfelsche/following{/other_user}","gists_url":"https://api.github.com/users/mfelsche/gists{/gist_id}","starred_url":"https://api.github.com/users/mfelsche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfelsche/subscriptions","organizations_url":"https://api.github.com/users/mfelsche/orgs","repos_url":"https://api.github.com/users/mfelsche/repos","events_url":"https://api.github.com/users/mfelsche/events{/privacy}","received_events_url":"https://api.github.com/users/mfelsche/received_events","type":"User","site_admin":false},"body":"you don't need to iterate here, could check first element only if groupBy.size() == 1 and return this boolean.","created_at":"2014-08-22T15:31:16Z","updated_at":"2014-08-22T15:31:16Z","html_url":"https://github.com/crate/crate/pull/1097#discussion_r16603842","pull_request_url":"https://api.github.com/repos/crate/crate/pulls/1097","_links":{"self":{"href":"https://api.github.com/repos/crate/crate/pulls/comments/16603842"},"html":{"href":"https://github.com/crate/crate/pull/1097#discussion_r16603842"},"pull_request":{"href":"https://api.github.com/repos/crate/crate/pulls/1097"}}},"pull_request":{"url":"https://api.github.com/repos/crate/crate/pulls/1097","id":20178209,"html_url":"https://github.com/crate/crate/pull/1097","diff_url":"https://github.com/crate/crate/pull/1097.diff","patch_url":"https://github.com/crate/crate/pull/1097.patch","issue_url":"https://api.github.com/repos/crate/crate/issues/1097","number":1097,"state":"open","locked":false,"title":"optimize execution plan if group by is on clustered by column","user":{"login":"mfussenegger","id":38700,"avatar_url":"https://avatars.githubusercontent.com/u/38700?v=2","gravatar_id":"a719cd47498dfc78f26907c817327e7f","url":"https://api.github.com/users/mfussenegger","html_url":"https://github.com/mfussenegger","followers_url":"https://api.github.com/users/mfussenegger/followers","following_url":"https://api.github.com/users/mfussenegger/following{/other_user}","gists_url":"https://api.github.com/users/mfussenegger/gists{/gist_id}","starred_url":"https://api.github.com/users/mfussenegger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfussenegger/subscriptions","organizations_url":"https://api.github.com/users/mfussenegger/orgs","repos_url":"https://api.github.com/users/mfussenegger/repos","events_url":"https://api.github.com/users/mfussenegger/events{/privacy}","received_events_url":"https://api.github.com/users/mfussenegger/received_events","type":"User","site_admin":false},"body":null,"created_at":"2014-08-22T15:23:06Z","updated_at":"2014-08-22T15:31:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d675c8cbd36c0310ecd0a2283ab2d5a858332b7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crate/crate/pulls/1097/commits","review_comments_url":"https://api.github.com/repos/crate/crate/pulls/1097/comments","review_comment_url":"https://api.github.com/repos/crate/crate/pulls/comments/{number}","comments_url":"https://api.github.com/repos/crate/crate/issues/1097/comments","statuses_url":"https://api.github.com/repos/crate/crate/statuses/24d014bdfb4c59a8d21c77144cc431f4dddf693a","head":{"label":"crate:j/optimize-clustered-groupby-plan","ref":"j/optimize-clustered-groupby-plan","sha":"24d014bdfb4c59a8d21c77144cc431f4dddf693a","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=2","gravatar_id":"24fdf75ca7948b2148a099b1867b6417","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":9342529,"name":"crate","full_name":"crate/crate","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=2","gravatar_id":"24fdf75ca7948b2148a099b1867b6417","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crate","description":"A massively scalable SQL data store. Zero administration required.","fork":false,"url":"https://api.github.com/repos/crate/crate","forks_url":"https://api.github.com/repos/crate/crate/forks","keys_url":"https://api.github.com/repos/crate/crate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crate/teams","hooks_url":"https://api.github.com/repos/crate/crate/hooks","issue_events_url":"https://api.github.com/repos/crate/crate/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crate/events","assignees_url":"https://api.github.com/repos/crate/crate/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crate/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crate/tags","blobs_url":"https://api.github.com/repos/crate/crate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crate/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crate/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crate/languages","stargazers_url":"https://api.github.com/repos/crate/crate/stargazers","contributors_url":"https://api.github.com/repos/crate/crate/contributors","subscribers_url":"https://api.github.com/repos/crate/crate/subscribers","subscription_url":"https://api.github.com/repos/crate/crate/subscription","commits_url":"https://api.github.com/repos/crate/crate/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crate/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crate/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crate/issues/comments/{number}","contents_url":"https://api.github.com/repos/crate/crate/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crate/merges","archive_url":"https://api.github.com/repos/crate/crate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crate/downloads","issues_url":"https://api.github.com/repos/crate/crate/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crate/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crate/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crate/labels{/name}","releases_url":"https://api.github.com/repos/crate/crate/releases{/id}","created_at":"2013-04-10T09:17:16Z","updated_at":"2014-08-21T13:10:34Z","pushed_at":"2014-08-22T15:27:34Z","git_url":"git://github.com/crate/crate.git","ssh_url":"git@github.com:crate/crate.git","clone_url":"https://github.com/crate/crate.git","svn_url":"https://github.com/crate/crate","homepage":"https://crate.io","size":73183,"stargazers_count":311,"watchers_count":311,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":21,"mirror_url":null,"open_issues_count":17,"forks":21,"open_issues":17,"watchers":311,"default_branch":"master"}},"base":{"label":"crate:master","ref":"master","sha":"88a8984939cb8c9d69b530ad4301eeb1bfe0b3e2","user":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=2","gravatar_id":"24fdf75ca7948b2148a099b1867b6417","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"repo":{"id":9342529,"name":"crate","full_name":"crate/crate","owner":{"login":"crate","id":4048232,"avatar_url":"https://avatars.githubusercontent.com/u/4048232?v=2","gravatar_id":"24fdf75ca7948b2148a099b1867b6417","url":"https://api.github.com/users/crate","html_url":"https://github.com/crate","followers_url":"https://api.github.com/users/crate/followers","following_url":"https://api.github.com/users/crate/following{/other_user}","gists_url":"https://api.github.com/users/crate/gists{/gist_id}","starred_url":"https://api.github.com/users/crate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crate/subscriptions","organizations_url":"https://api.github.com/users/crate/orgs","repos_url":"https://api.github.com/users/crate/repos","events_url":"https://api.github.com/users/crate/events{/privacy}","received_events_url":"https://api.github.com/users/crate/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crate/crate","description":"A massively scalable SQL data store. Zero administration required.","fork":false,"url":"https://api.github.com/repos/crate/crate","forks_url":"https://api.github.com/repos/crate/crate/forks","keys_url":"https://api.github.com/repos/crate/crate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crate/crate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crate/crate/teams","hooks_url":"https://api.github.com/repos/crate/crate/hooks","issue_events_url":"https://api.github.com/repos/crate/crate/issues/events{/number}","events_url":"https://api.github.com/repos/crate/crate/events","assignees_url":"https://api.github.com/repos/crate/crate/assignees{/user}","branches_url":"https://api.github.com/repos/crate/crate/branches{/branch}","tags_url":"https://api.github.com/repos/crate/crate/tags","blobs_url":"https://api.github.com/repos/crate/crate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crate/crate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crate/crate/git/refs{/sha}","trees_url":"https://api.github.com/repos/crate/crate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crate/crate/statuses/{sha}","languages_url":"https://api.github.com/repos/crate/crate/languages","stargazers_url":"https://api.github.com/repos/crate/crate/stargazers","contributors_url":"https://api.github.com/repos/crate/crate/contributors","subscribers_url":"https://api.github.com/repos/crate/crate/subscribers","subscription_url":"https://api.github.com/repos/crate/crate/subscription","commits_url":"https://api.github.com/repos/crate/crate/commits{/sha}","git_commits_url":"https://api.github.com/repos/crate/crate/git/commits{/sha}","comments_url":"https://api.github.com/repos/crate/crate/comments{/number}","issue_comment_url":"https://api.github.com/repos/crate/crate/issues/comments/{number}","contents_url":"https://api.github.com/repos/crate/crate/contents/{+path}","compare_url":"https://api.github.com/repos/crate/crate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crate/crate/merges","archive_url":"https://api.github.com/repos/crate/crate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crate/crate/downloads","issues_url":"https://api.github.com/repos/crate/crate/issues{/number}","pulls_url":"https://api.github.com/repos/crate/crate/pulls{/number}","milestones_url":"https://api.github.com/repos/crate/crate/milestones{/number}","notifications_url":"https://api.github.com/repos/crate/crate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crate/crate/labels{/name}","releases_url":"https://api.github.com/repos/crate/crate/releases{/id}","created_at":"2013-04-10T09:17:16Z","updated_at":"2014-08-21T13:10:34Z","pushed_at":"2014-08-22T15:27:34Z","git_url":"git://github.com/crate/crate.git","ssh_url":"git@github.com:crate/crate.git","clone_url":"https://github.com/crate/crate.git","svn_url":"https://github.com/crate/crate","homepage":"https://crate.io","size":73183,"stargazers_count":311,"watchers_count":311,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":21,"mirror_url":null,"open_issues_count":17,"forks":21,"open_issues":17,"watchers":311,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crate/crate/pulls/1097"},"html":{"href":"https://github.com/crate/crate/pull/1097"},"issue":{"href":"https://api.github.com/repos/crate/crate/issues/1097"},"comments":{"href":"https://api.github.com/repos/crate/crate/issues/1097/comments"},"review_comments":{"href":"https://api.github.com/repos/crate/crate/pulls/1097/comments"},"review_comment":{"href":"https://api.github.com/repos/crate/crate/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/crate/crate/pulls/1097/commits"},"statuses":{"href":"https://api.github.com/repos/crate/crate/statuses/24d014bdfb4c59a8d21c77144cc431f4dddf693a"}}}}