{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/10566","labels_url":"https://api.github.com/repos/apache/spark/issues/10566/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/10566/comments","events_url":"https://api.github.com/repos/apache/spark/issues/10566/events","html_url":"https://github.com/apache/spark/pull/10566","id":124688213,"number":10566,"title":"[SPARK-12613] [SQL] Outer Join Elimination by Parent Join Condition","user":{"login":"gatorsmile","id":11567269,"avatar_url":"https://avatars.githubusercontent.com/u/11567269?v=3","gravatar_id":"","url":"https://api.github.com/users/gatorsmile","html_url":"https://github.com/gatorsmile","followers_url":"https://api.github.com/users/gatorsmile/followers","following_url":"https://api.github.com/users/gatorsmile/following{/other_user}","gists_url":"https://api.github.com/users/gatorsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gatorsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatorsmile/subscriptions","organizations_url":"https://api.github.com/users/gatorsmile/orgs","repos_url":"https://api.github.com/users/gatorsmile/repos","events_url":"https://api.github.com/users/gatorsmile/events{/privacy}","received_events_url":"https://api.github.com/users/gatorsmile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-04T02:48:38Z","updated_at":"2016-01-04T06:36:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10566","html_url":"https://github.com/apache/spark/pull/10566","diff_url":"https://github.com/apache/spark/pull/10566.diff","patch_url":"https://github.com/apache/spark/pull/10566.patch"},"body":"This PR is another enhancement to Optimizer. It does not conflict with the other PRs (https://github.com/apache/spark/pull/10567 and https://github.com/apache/spark/pull/10551).  \r\n\r\nGiven an outer join (**OJ**) is involved in another join (called parent join **PJ**), when the join type of **PJ**  is `inner`, `left-semi`, `left-outer` and `right-outer`, checking if the join condition of the  **PJ** satisfies the following two conditions:\r\n  1) there exist null filtering predicates against the columns in the null-supplying side of **PJ**.\r\n  2) these columns are from **OJ**.\r\n\r\nIf having such join predicates, execute the elimination rules:\r\n - `full outer` -> `inner` if both sides of **OJ** have such predicates\r\n - `left outer` -> `inner` if the right side of **OJ** has such predicates\r\n - `right outer` -> `inner` if the left side of **OJ** has such predicates\r\n - `full outer` -> `left outer` if only the left side of **OJ** has such predicates\r\n - `full outer` -> `right outer` if only the right side of **OJ** has such predicates\r\n\r\nIf applicable, this can greatly improve the performance, since `outer join` is much slower than `inner join`, `full outer` join is much slower than `left`/`right outer` join. \r\n\r\nBTW, since the rule is different from the rule in https://github.com/apache/spark/pull/10567, I did not merge them in the same one for simplifying the code review. "},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/168595589","html_url":"https://github.com/apache/spark/pull/10566#issuecomment-168595589","issue_url":"https://api.github.com/repos/apache/spark/issues/10566","id":168595589,"user":{"login":"gatorsmile","id":11567269,"avatar_url":"https://avatars.githubusercontent.com/u/11567269?v=3","gravatar_id":"","url":"https://api.github.com/users/gatorsmile","html_url":"https://github.com/gatorsmile","followers_url":"https://api.github.com/users/gatorsmile/followers","following_url":"https://api.github.com/users/gatorsmile/following{/other_user}","gists_url":"https://api.github.com/users/gatorsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gatorsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatorsmile/subscriptions","organizations_url":"https://api.github.com/users/gatorsmile/orgs","repos_url":"https://api.github.com/users/gatorsmile/repos","events_url":"https://api.github.com/users/gatorsmile/events{/privacy}","received_events_url":"https://api.github.com/users/gatorsmile/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T06:36:40Z","updated_at":"2016-01-04T06:36:40Z","body":"Sure, I can make a try! Thank you!"}}