{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/46462206","id":46462206,"diff_hunk":"@@ -911,3 +913,51 @@ object RemoveLiteralFromGroupExpressions extends Rule[LogicalPlan] {\n       a.copy(groupingExpressions = newGrouping)\n   }\n }\n+\n+/**\n+ * Extracts the equal-join condition if any, so that query planner avoids generating cartsian\n+ * product which cause out of memory exception, and performance issues","path":"sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala","position":16,"original_position":16,"commit_id":"d09d905180c0eb9d8b1ed9aaf5d207e2fac6547c","original_commit_id":"d09d905180c0eb9d8b1ed9aaf5d207e2fac6547c","user":{"login":"nongli","id":242468,"avatar_url":"https://avatars.githubusercontent.com/u/242468?v=3","gravatar_id":"","url":"https://api.github.com/users/nongli","html_url":"https://github.com/nongli","followers_url":"https://api.github.com/users/nongli/followers","following_url":"https://api.github.com/users/nongli/following{/other_user}","gists_url":"https://api.github.com/users/nongli/gists{/gist_id}","starred_url":"https://api.github.com/users/nongli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nongli/subscriptions","organizations_url":"https://api.github.com/users/nongli/orgs","repos_url":"https://api.github.com/users/nongli/repos","events_url":"https://api.github.com/users/nongli/events{/privacy}","received_events_url":"https://api.github.com/users/nongli/received_events","type":"User","site_admin":false},"body":"Can we make this rule simpler and more general? It seems the rule is aptly named, \"CNF factorization\", and should just do a transformation on expressions (instead of transforming the plan tree and specific to joins). The rest of the rules should then properly fix the join i think.","created_at":"2015-12-02T19:28:37Z","updated_at":"2015-12-02T19:28:37Z","html_url":"https://github.com/apache/spark/pull/10087#discussion_r46462206","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/10087","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/46462206"},"html":{"href":"https://github.com/apache/spark/pull/10087#discussion_r46462206"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/10087"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10087","id":52345769,"html_url":"https://github.com/apache/spark/pull/10087","diff_url":"https://github.com/apache/spark/pull/10087.diff","patch_url":"https://github.com/apache/spark/pull/10087.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/10087","number":10087,"state":"open","locked":false,"title":"[SPARK-12085] [SQL] The join condition hidden in DNF can't be pushed down to join operator ","user":{"login":"flyson","id":1904739,"avatar_url":"https://avatars.githubusercontent.com/u/1904739?v=3","gravatar_id":"","url":"https://api.github.com/users/flyson","html_url":"https://github.com/flyson","followers_url":"https://api.github.com/users/flyson/followers","following_url":"https://api.github.com/users/flyson/following{/other_user}","gists_url":"https://api.github.com/users/flyson/gists{/gist_id}","starred_url":"https://api.github.com/users/flyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyson/subscriptions","organizations_url":"https://api.github.com/users/flyson/orgs","repos_url":"https://api.github.com/users/flyson/repos","events_url":"https://api.github.com/users/flyson/events{/privacy}","received_events_url":"https://api.github.com/users/flyson/received_events","type":"User","site_admin":false},"body":"This patch analyzes the filter expression represented as DNF and extract the common equality conditions that match the join relations and expose it out so that the join condition can be pushed down by PushPredicateThroughJoin rule.\r\n\r\nWith this patch we saw significant performance improvement on TPC-H q19. ","created_at":"2015-12-02T02:27:10Z","updated_at":"2015-12-02T19:28:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4b970fdd8d2404bd55b566337b74ae1b8e0c199e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/10087/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/10087/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/10087/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/d09d905180c0eb9d8b1ed9aaf5d207e2fac6547c","head":{"label":"flyson:master","ref":"master","sha":"d09d905180c0eb9d8b1ed9aaf5d207e2fac6547c","user":{"login":"flyson","id":1904739,"avatar_url":"https://avatars.githubusercontent.com/u/1904739?v=3","gravatar_id":"","url":"https://api.github.com/users/flyson","html_url":"https://github.com/flyson","followers_url":"https://api.github.com/users/flyson/followers","following_url":"https://api.github.com/users/flyson/following{/other_user}","gists_url":"https://api.github.com/users/flyson/gists{/gist_id}","starred_url":"https://api.github.com/users/flyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyson/subscriptions","organizations_url":"https://api.github.com/users/flyson/orgs","repos_url":"https://api.github.com/users/flyson/repos","events_url":"https://api.github.com/users/flyson/events{/privacy}","received_events_url":"https://api.github.com/users/flyson/received_events","type":"User","site_admin":false},"repo":{"id":46813082,"name":"spark","full_name":"flyson/spark","owner":{"login":"flyson","id":1904739,"avatar_url":"https://avatars.githubusercontent.com/u/1904739?v=3","gravatar_id":"","url":"https://api.github.com/users/flyson","html_url":"https://github.com/flyson","followers_url":"https://api.github.com/users/flyson/followers","following_url":"https://api.github.com/users/flyson/following{/other_user}","gists_url":"https://api.github.com/users/flyson/gists{/gist_id}","starred_url":"https://api.github.com/users/flyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyson/subscriptions","organizations_url":"https://api.github.com/users/flyson/orgs","repos_url":"https://api.github.com/users/flyson/repos","events_url":"https://api.github.com/users/flyson/events{/privacy}","received_events_url":"https://api.github.com/users/flyson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flyson/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/flyson/spark","forks_url":"https://api.github.com/repos/flyson/spark/forks","keys_url":"https://api.github.com/repos/flyson/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flyson/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flyson/spark/teams","hooks_url":"https://api.github.com/repos/flyson/spark/hooks","issue_events_url":"https://api.github.com/repos/flyson/spark/issues/events{/number}","events_url":"https://api.github.com/repos/flyson/spark/events","assignees_url":"https://api.github.com/repos/flyson/spark/assignees{/user}","branches_url":"https://api.github.com/repos/flyson/spark/branches{/branch}","tags_url":"https://api.github.com/repos/flyson/spark/tags","blobs_url":"https://api.github.com/repos/flyson/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flyson/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flyson/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/flyson/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flyson/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/flyson/spark/languages","stargazers_url":"https://api.github.com/repos/flyson/spark/stargazers","contributors_url":"https://api.github.com/repos/flyson/spark/contributors","subscribers_url":"https://api.github.com/repos/flyson/spark/subscribers","subscription_url":"https://api.github.com/repos/flyson/spark/subscription","commits_url":"https://api.github.com/repos/flyson/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/flyson/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/flyson/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/flyson/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/flyson/spark/contents/{+path}","compare_url":"https://api.github.com/repos/flyson/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flyson/spark/merges","archive_url":"https://api.github.com/repos/flyson/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flyson/spark/downloads","issues_url":"https://api.github.com/repos/flyson/spark/issues{/number}","pulls_url":"https://api.github.com/repos/flyson/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/flyson/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/flyson/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flyson/spark/labels{/name}","releases_url":"https://api.github.com/repos/flyson/spark/releases{/id}","created_at":"2015-11-24T19:18:30Z","updated_at":"2015-11-24T19:19:02Z","pushed_at":"2015-12-02T02:06:22Z","git_url":"git://github.com/flyson/spark.git","ssh_url":"git@github.com:flyson/spark.git","clone_url":"https://github.com/flyson/spark.git","svn_url":"https://github.com/flyson/spark","homepage":null,"size":137826,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"e96a70d5ab2e2b43a2df17a550fa9ed2ee0001c4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","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?v=3","gravatar_id":"","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":"2015-12-02T17:36:42Z","pushed_at":"2015-12-02T19:22:48Z","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":388977,"stargazers_count":6428,"watchers_count":6428,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5938,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":391,"forks":5938,"open_issues":391,"watchers":6428,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/10087"},"html":{"href":"https://github.com/apache/spark/pull/10087"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/10087"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/10087/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/10087/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/10087/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/d09d905180c0eb9d8b1ed9aaf5d207e2fac6547c"}}}}