{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/4354","labels_url":"https://api.github.com/repos/apache/spark/issues/4354/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/4354/comments","events_url":"https://api.github.com/repos/apache/spark/issues/4354/events","html_url":"https://github.com/apache/spark/pull/4354","id":56477778,"number":4354,"title":"[SPARK-5583][SQL][WIP] Support unique join in hive context","user":{"login":"scwf","id":7018048,"avatar_url":"https://avatars.githubusercontent.com/u/7018048?v=3","gravatar_id":"","url":"https://api.github.com/users/scwf","html_url":"https://github.com/scwf","followers_url":"https://api.github.com/users/scwf/followers","following_url":"https://api.github.com/users/scwf/following{/other_user}","gists_url":"https://api.github.com/users/scwf/gists{/gist_id}","starred_url":"https://api.github.com/users/scwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scwf/subscriptions","organizations_url":"https://api.github.com/users/scwf/orgs","repos_url":"https://api.github.com/users/scwf/repos","events_url":"https://api.github.com/users/scwf/events{/privacy}","received_events_url":"https://api.github.com/users/scwf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-04T04:09:47Z","updated_at":"2015-02-04T04:27:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/4354","html_url":"https://github.com/apache/spark/pull/4354","diff_url":"https://github.com/apache/spark/pull/4354.diff","patch_url":"https://github.com/apache/spark/pull/4354.patch"},"body":"Support unique join in hive context, the basic idea is transform unique join into outer join + filter in spark sql:\r\n\r\n`FROM UNIQUEJOIN [PRESERVE] T1 a (a.key), [PRESERVE] T2 b (b.key), [PRESERVE] T3 c (c.key) ...`\r\n\r\nIf all the tables have PRESERVE keyword ==> `T1 full out join T2 full out join T3 ...`\r\nelse If all the tables do not have PRESERVE keyword ==> `T1 inner join T2 inner join T3 ...`\r\nelse ==>\r\n     T = (T1 full out join T2 full out join T3 ...)\r\n     Filter on T, filter condition = keep the rows with any preserve field is not null.\r\n\r\nfor examples:\r\n1 `T1 a (a.key), PRESERVE T2 b (b.key), PRESERVE T3 c (c.key)` ==> if b.key is not null or c.key is not null, we'll keep the row\r\n2 `T1 a (a.key), T2 b (b.key), PRESERVE T3 c (c.key) ` ==> if c.key is not null we'll keep the row\r\n\r\nCorrect me if i am wrong.  \r\n\r\ntodos: add tests for this"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/72788828","html_url":"https://github.com/apache/spark/pull/4354#issuecomment-72788828","issue_url":"https://api.github.com/repos/apache/spark/issues/4354","id":72788828,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T04:27:32Z","updated_at":"2015-02-04T04:27:32Z","body":"  [Test build #26722 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/26722/consoleFull) for   PR 4354 at commit [`dd34ebf`](https://github.com/apache/spark/commit/dd34ebf60295046cb1bc82862b6c0a86ce2f8837).\n * This patch merges cleanly."}}