{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/114472786","pull_request_review_id":35940135,"id":114472786,"diff_hunk":"@@ -0,0 +1,98 @@\n+/*\n+ * Licensed to Metamarkets Group Inc. (Metamarkets) under one\n+ * or more contributor license agreements. See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership. Metamarkets licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License. You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package io.druid.query;\n+\n+import com.fasterxml.jackson.annotation.JsonProperty;\n+import com.google.common.collect.Maps;\n+import com.google.common.collect.Ordering;\n+import io.druid.java.util.common.guava.Sequence;\n+\n+import java.util.Map;\n+\n+public abstract class MultiSourceBaseQuery<T extends Comparable<T>> implements Query<T>","path":"processing/src/main/java/io/druid/query/MultiSourceBaseQuery.java","position":29,"original_position":29,"commit_id":"5df777d57b74810481231f0684a4c4cdcb4f4648","original_commit_id":"d8d1e3ec12b27e0426b3139dedcac1b7ab0a1702","user":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars0.githubusercontent.com/u/2322288?v=3","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"body":"Well, I think this is needed for future extension. It currently has only a single subclass, but can have other ones in the future. For example, we can add more classes for different join algorithms like we have several classes (groupBy, topN, and timeseries) for aggregation queries. ","created_at":"2017-05-03T05:03:01Z","updated_at":"2017-05-03T05:03:01Z","html_url":"https://github.com/druid-io/druid/pull/4118#discussion_r114472786","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/4118","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/114472786"},"html":{"href":"https://github.com/druid-io/druid/pull/4118#discussion_r114472786"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/4118"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/4118","id":112634329,"html_url":"https://github.com/druid-io/druid/pull/4118","diff_url":"https://github.com/druid-io/druid/pull/4118.diff","patch_url":"https://github.com/druid-io/druid/pull/4118.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/4118","number":4118,"state":"open","locked":false,"title":"Add JoinQuery","user":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars0.githubusercontent.com/u/2322288?v=3","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"body":"Second patch for #4032. \r\n\r\nHere are the highlights of the changes.\r\n* Extended ```Query``` to be able to have multiple data sources.  \r\n* Added ```JoinQuery```\r\n* Added a new method ```annotateDistributionTarget``` to ```QueryToolChest```. ```CachingClusteredClient``` can figure out which data source is the target of query distribution when choosing nodes for query processing.\r\n* ```DimensionSpec``` is changed to have an optional dataSource name field. Another option for this is to force the name of ```DimensionSpec``` to always be prefixed with its dataSource name like ```'foo.dim1'```. I think this is error-prone, and thus the former option is better.\r\n*  Currently, metrics are represented as a list of simple strings, so they must be forced to be prefixed their dataSource names. However, in the future, I think we need a new data structure for metrics like ```DimensionSpec```, or extend ```DimensionSpec``` to cover metrics as well. (It's possible because it now supports long and double columns.) \r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/druid-io/druid/4118)\r\n<!-- Reviewable:end -->\r\n","created_at":"2017-03-26T16:44:46Z","updated_at":"2017-05-03T05:03:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e91843c4493d10565bfcfe5dab6124b87ed9e0f7","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/druid-io/druid/milestones/23","html_url":"https://github.com/druid-io/druid/milestone/23","labels_url":"https://api.github.com/repos/druid-io/druid/milestones/23/labels","id":2338417,"number":23,"title":"0.11.0","description":"","creator":{"login":"gianm","id":1214075,"avatar_url":"https://avatars0.githubusercontent.com/u/1214075?v=3","gravatar_id":"","url":"https://api.github.com/users/gianm","html_url":"https://github.com/gianm","followers_url":"https://api.github.com/users/gianm/followers","following_url":"https://api.github.com/users/gianm/following{/other_user}","gists_url":"https://api.github.com/users/gianm/gists{/gist_id}","starred_url":"https://api.github.com/users/gianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gianm/subscriptions","organizations_url":"https://api.github.com/users/gianm/orgs","repos_url":"https://api.github.com/users/gianm/repos","events_url":"https://api.github.com/users/gianm/events{/privacy}","received_events_url":"https://api.github.com/users/gianm/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2017-02-21T17:48:27Z","updated_at":"2017-05-01T22:47:27Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/4118/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/4118/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/4118/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/5df777d57b74810481231f0684a4c4cdcb4f4648","head":{"label":"jihoonson:join-query","ref":"join-query","sha":"5df777d57b74810481231f0684a4c4cdcb4f4648","user":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars0.githubusercontent.com/u/2322288?v=3","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"repo":{"id":71565181,"name":"druid","full_name":"jihoonson/druid","owner":{"login":"jihoonson","id":2322288,"avatar_url":"https://avatars0.githubusercontent.com/u/2322288?v=3","gravatar_id":"","url":"https://api.github.com/users/jihoonson","html_url":"https://github.com/jihoonson","followers_url":"https://api.github.com/users/jihoonson/followers","following_url":"https://api.github.com/users/jihoonson/following{/other_user}","gists_url":"https://api.github.com/users/jihoonson/gists{/gist_id}","starred_url":"https://api.github.com/users/jihoonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihoonson/subscriptions","organizations_url":"https://api.github.com/users/jihoonson/orgs","repos_url":"https://api.github.com/users/jihoonson/repos","events_url":"https://api.github.com/users/jihoonson/events{/privacy}","received_events_url":"https://api.github.com/users/jihoonson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jihoonson/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":true,"url":"https://api.github.com/repos/jihoonson/druid","forks_url":"https://api.github.com/repos/jihoonson/druid/forks","keys_url":"https://api.github.com/repos/jihoonson/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jihoonson/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jihoonson/druid/teams","hooks_url":"https://api.github.com/repos/jihoonson/druid/hooks","issue_events_url":"https://api.github.com/repos/jihoonson/druid/issues/events{/number}","events_url":"https://api.github.com/repos/jihoonson/druid/events","assignees_url":"https://api.github.com/repos/jihoonson/druid/assignees{/user}","branches_url":"https://api.github.com/repos/jihoonson/druid/branches{/branch}","tags_url":"https://api.github.com/repos/jihoonson/druid/tags","blobs_url":"https://api.github.com/repos/jihoonson/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jihoonson/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jihoonson/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/jihoonson/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jihoonson/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/jihoonson/druid/languages","stargazers_url":"https://api.github.com/repos/jihoonson/druid/stargazers","contributors_url":"https://api.github.com/repos/jihoonson/druid/contributors","subscribers_url":"https://api.github.com/repos/jihoonson/druid/subscribers","subscription_url":"https://api.github.com/repos/jihoonson/druid/subscription","commits_url":"https://api.github.com/repos/jihoonson/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/jihoonson/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/jihoonson/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/jihoonson/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/jihoonson/druid/contents/{+path}","compare_url":"https://api.github.com/repos/jihoonson/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jihoonson/druid/merges","archive_url":"https://api.github.com/repos/jihoonson/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jihoonson/druid/downloads","issues_url":"https://api.github.com/repos/jihoonson/druid/issues{/number}","pulls_url":"https://api.github.com/repos/jihoonson/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/jihoonson/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/jihoonson/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jihoonson/druid/labels{/name}","releases_url":"https://api.github.com/repos/jihoonson/druid/releases{/id}","deployments_url":"https://api.github.com/repos/jihoonson/druid/deployments","created_at":"2016-10-21T13:05:19Z","updated_at":"2016-10-21T13:05:32Z","pushed_at":"2017-05-03T05:00:03Z","git_url":"git://github.com/jihoonson/druid.git","ssh_url":"git@github.com:jihoonson/druid.git","clone_url":"https://github.com/jihoonson/druid.git","svn_url":"https://github.com/jihoonson/druid","homepage":"http://druid.io","size":120208,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"druid-io:master","ref":"master","sha":"f9a61ea2ba01f5a938a8347d2633bd5793fd7b0d","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars3.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars3.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","deployments_url":"https://api.github.com/repos/druid-io/druid/deployments","created_at":"2012-10-23T19:08:07Z","updated_at":"2017-05-03T03:05:01Z","pushed_at":"2017-05-03T05:00:05Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":119747,"stargazers_count":4801,"watchers_count":4801,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1143,"mirror_url":null,"open_issues_count":678,"forks":1143,"open_issues":678,"watchers":4801,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/4118"},"html":{"href":"https://github.com/druid-io/druid/pull/4118"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/4118"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/4118/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/4118/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/4118/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/5df777d57b74810481231f0684a4c4cdcb4f4648"}}}}
{"actor":{"display_login":"jihoonson"}}