GitHub PullRequestReviewCommentEvent at 2014-06-21 18:41:44
Repository: spark
Actor: marmbrus
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/14051069","id":14051069,"diff_hunk":"@@ -245,6 +245,73 @@ case class LeftSemiJoinBNL(\n   }\n }\n \n+\n+\n+\n+\n+/**\n+ * :: DeveloperApi ::\n+ * LeftSemiBloomFilterBroadcastJoin\n+ * Sometimes the semijoin's broadcast table can't fit memory.So  we can make it as Bloomfilter to  reduce the space\n+ * and then broadcast it do the mapside  join\n+ * The bloomfilter  use Shark's BloomFilter class implementation.\n+ */\n+@DeveloperApi\n+case class LeftSemiJoinBFB(\n+                            leftKeys: Seq[Expression],","path":"sql/core/src/main/scala/org/apache/spark/sql/execution/joins.scala","position":17,"original_position":17,"commit_id":"e13f150b1f666757945ee64d1e235f03bd012d3f","original_commit_id":"e13f150b1f666757945ee64d1e235f03bd012d3f","user":{"login":"marmbrus","id":527,"avatar_url":"https://avatars.githubusercontent.com/u/527?","gravatar_id":"6b296d9deae02902b9ab42d444a12d94","url":"https://api.github.com/users/marmbrus","html_url":"https://github.com/marmbrus","followers_url":"https://api.github.com/users/marmbrus/followers","following_url":"https://api.github.com/users/marmbrus/following{/other_user}","gists_url":"https://api.github.com/users/marmbrus/gists{/gist_id}","starred_url":"https://api.github.com/users/marmbrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmbrus/subscriptions","organizations_url":"https://api.github.com/users/marmbrus/orgs","repos_url":"https://api.github.com/users/marmbrus/repos","events_url":"https://api.github.com/users/marmbrus/events{/privacy}","received_events_url":"https://api.github.com/users/marmbrus/received_events","type":"User","site_admin":false},"body":"Indent 4 spaces.  Also I'd go with the full more descriptive name instead of BFB since we are only going to have to type it out in like 2 places.","created_at":"2014-06-21T18:41:44Z","updated_at":"2014-06-21T18:41:44Z","html_url":"https://github.com/apache/spark/pull/1127#discussion_r14051069","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/1127","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/14051069"},"html":{"href":"https://github.com/apache/spark/pull/1127#discussion_r14051069"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/1127"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/1127","id":17333148,"html_url":"https://github.com/apache/spark/pull/1127","diff_url":"https://github.com/apache/spark/pull/1127.diff","patch_url":"https://github.com/apache/spark/pull/1127.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/1127","number":1127,"state":"open","title":"Spark SQL add LeftSemiBloomFilterBroadcastJoin","user":{"login":"YanjieGao","id":5576848,"avatar_url":"https://avatars.githubusercontent.com/u/5576848?","gravatar_id":"fc0ae65a7195a940b2ca0f8245e6e810","url":"https://api.github.com/users/YanjieGao","html_url":"https://github.com/YanjieGao","followers_url":"https://api.github.com/users/YanjieGao/followers","following_url":"https://api.github.com/users/YanjieGao/following{/other_user}","gists_url":"https://api.github.com/users/YanjieGao/gists{/gist_id}","starred_url":"https://api.github.com/users/YanjieGao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanjieGao/subscriptions","organizations_url":"https://api.github.com/users/YanjieGao/orgs","repos_url":"https://api.github.com/users/YanjieGao/repos","events_url":"https://api.github.com/users/YanjieGao/events{/privacy}","received_events_url":"https://api.github.com/users/YanjieGao/received_events","type":"User","site_admin":false},"body":"Hi ,All .\r\nI want to submit  a join operator called\r\nLeftSemiBloomFilterBroadcastJoin (LeftSemiJoinBFB)\r\nSometimes the Semijoin's broadcast table can't fit memory.So  we can make it as Bloomfilter to  reduce the space  and then broadcast it do the mapside  join .\r\nSome code  reference HashJoin and BroadcastNestedLoopJoin implementation.\r\nThe bloomfilter  code   use Shark's BloomFilter class implementation.\r\n\r\n\r\nThis main code is in the patch file \r\n\r\nhere is the strategies code\r\n\r\n  object LeftSemiJoinBFB extends Strategy with PredicateHelper {\r\n    def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {\r\n      case LeftSemiJoinBFBFilteredJoin(Inner, leftKeys, rightKeys, condition, left, right) =>\r\n        val hashJoin =\r\n          execution.LeftSemiJoinBFBJoin(leftKeys, rightKeys, BuildRight, planLater(left), planLater(right),sparkContext)\r\n        condition.map(Filter(_, hashJoin)).getOrElse(hashJoin) :: Nil\r\n      case _ => Nil\r\n    }\r\n  }\r\n\r\nhere is the code patterns\r\n\r\n\r\nobject LeftSemiJoinBFBFilteredJoin extends Logging with PredicateHelper {\r\n  /** (joinType, rightKeys, leftKeys, condition, leftChild, rightChild) */\r\n  type ReturnType =\r\n  (JoinType, Seq[Expression], Seq[Expression], Option[Expression], LogicalPlan, LogicalPlan)\r\n\r\n  def unapply(plan: LogicalPlan): Option[ReturnType] = plan match {\r\n    // All predicates can be evaluated for inner join (i.e., those that are in the ON\r\n    // clause and WHERE clause.)\r\n    case FilteredOperation(predicates, join @ Join(left, right, Inner, condition)) =>\r\n      logger.debug(s\"Considering Semi inner join on: ${predicates ++ condition}\")\r\n      splitPredicates(predicates ++ condition, join)\r\n    case join @ Join(left, right, joinType, condition) =>\r\n      logger.debug(s\"Considering Semi join on: $condition\")\r\n      splitPredicates(condition.toSeq, join)\r\n    case _ => None\r\n  }\r\n\r\n","created_at":"2014-06-19T04:41:10Z","updated_at":"2014-06-21T18:41:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4dcb29505d1e51774ba1acf2f35e3755d1a76f12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/1127/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/1127/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/spark/issues/1127/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/e13f150b1f666757945ee64d1e235f03bd012d3f","head":{"label":"YanjieGao:patch-2","ref":"patch-2","sha":"e13f150b1f666757945ee64d1e235f03bd012d3f","user":{"login":"YanjieGao","id":5576848,"avatar_url":"https://avatars.githubusercontent.com/u/5576848?","gravatar_id":"fc0ae65a7195a940b2ca0f8245e6e810","url":"https://api.github.com/users/YanjieGao","html_url":"https://github.com/YanjieGao","followers_url":"https://api.github.com/users/YanjieGao/followers","following_url":"https://api.github.com/users/YanjieGao/following{/other_user}","gists_url":"https://api.github.com/users/YanjieGao/gists{/gist_id}","starred_url":"https://api.github.com/users/YanjieGao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanjieGao/subscriptions","organizations_url":"https://api.github.com/users/YanjieGao/orgs","repos_url":"https://api.github.com/users/YanjieGao/repos","events_url":"https://api.github.com/users/YanjieGao/events{/privacy}","received_events_url":"https://api.github.com/users/YanjieGao/received_events","type":"User","site_admin":false},"repo":{"id":19693325,"name":"spark","full_name":"YanjieGao/spark","owner":{"login":"YanjieGao","id":5576848,"avatar_url":"https://avatars.githubusercontent.com/u/5576848?","gravatar_id":"fc0ae65a7195a940b2ca0f8245e6e810","url":"https://api.github.com/users/YanjieGao","html_url":"https://github.com/YanjieGao","followers_url":"https://api.github.com/users/YanjieGao/followers","following_url":"https://api.github.com/users/YanjieGao/following{/other_user}","gists_url":"https://api.github.com/users/YanjieGao/gists{/gist_id}","starred_url":"https://api.github.com/users/YanjieGao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YanjieGao/subscriptions","organizations_url":"https://api.github.com/users/YanjieGao/orgs","repos_url":"https://api.github.com/users/YanjieGao/repos","events_url":"https://api.github.com/users/YanjieGao/events{/privacy}","received_events_url":"https://api.github.com/users/YanjieGao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/YanjieGao/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/YanjieGao/spark","forks_url":"https://api.github.com/repos/YanjieGao/spark/forks","keys_url":"https://api.github.com/repos/YanjieGao/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YanjieGao/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YanjieGao/spark/teams","hooks_url":"https://api.github.com/repos/YanjieGao/spark/hooks","issue_events_url":"https://api.github.com/repos/YanjieGao/spark/issues/events{/number}","events_url":"https://api.github.com/repos/YanjieGao/spark/events","assignees_url":"https://api.github.com/repos/YanjieGao/spark/assignees{/user}","branches_url":"https://api.github.com/repos/YanjieGao/spark/branches{/branch}","tags_url":"https://api.github.com/repos/YanjieGao/spark/tags","blobs_url":"https://api.github.com/repos/YanjieGao/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YanjieGao/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YanjieGao/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/YanjieGao/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YanjieGao/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/YanjieGao/spark/languages","stargazers_url":"https://api.github.com/repos/YanjieGao/spark/stargazers","contributors_url":"https://api.github.com/repos/YanjieGao/spark/contributors","subscribers_url":"https://api.github.com/repos/YanjieGao/spark/subscribers","subscription_url":"https://api.github.com/repos/YanjieGao/spark/subscription","commits_url":"https://api.github.com/repos/YanjieGao/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/YanjieGao/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/YanjieGao/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/YanjieGao/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/YanjieGao/spark/contents/{+path}","compare_url":"https://api.github.com/repos/YanjieGao/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YanjieGao/spark/merges","archive_url":"https://api.github.com/repos/YanjieGao/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YanjieGao/spark/downloads","issues_url":"https://api.github.com/repos/YanjieGao/spark/issues{/number}","pulls_url":"https://api.github.com/repos/YanjieGao/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/YanjieGao/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/YanjieGao/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YanjieGao/spark/labels{/name}","releases_url":"https://api.github.com/repos/YanjieGao/spark/releases{/id}","created_at":"2014-05-12T09:42:20Z","updated_at":"2014-06-20T09:01:59Z","pushed_at":"2014-06-20T09:02:00Z","git_url":"git://github.com/YanjieGao/spark.git","ssh_url":"git@github.com:YanjieGao/spark.git","clone_url":"https://github.com/YanjieGao/spark.git","svn_url":"https://github.com/YanjieGao/spark","homepage":null,"size":70257,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"5ff75c748a27bcfae71759d0e509218f0c5d0200","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?","gravatar_id":"a676c0bf448fcd49f588249ead719b4c","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?","gravatar_id":"a676c0bf448fcd49f588249ead719b4c","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2014-06-21T18:17:58Z","pushed_at":"2014-06-21T05:50:14Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1752169,"stargazers_count":655,"watchers_count":655,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":669,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":192,"forks":669,"open_issues":192,"watchers":655,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/1127"},"html":{"href":"https://github.com/apache/spark/pull/1127"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/1127"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/1127/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/1127/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/1127/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/e13f150b1f666757945ee64d1e235f03bd012d3f"}}}}