{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/6351","labels_url":"https://api.github.com/repos/apache/spark/issues/6351/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/6351/comments","events_url":"https://api.github.com/repos/apache/spark/issues/6351/events","html_url":"https://github.com/apache/spark/pull/6351","id":79390035,"number":6351,"title":"[SPARK-7824][SQL]Collapsing operator reordering and constant folding into a single batch  to push down the single side.","user":{"login":"DoingDone9","id":7529754,"avatar_url":"https://avatars.githubusercontent.com/u/7529754?v=3","gravatar_id":"","url":"https://api.github.com/users/DoingDone9","html_url":"https://github.com/DoingDone9","followers_url":"https://api.github.com/users/DoingDone9/followers","following_url":"https://api.github.com/users/DoingDone9/following{/other_user}","gists_url":"https://api.github.com/users/DoingDone9/gists{/gist_id}","starred_url":"https://api.github.com/users/DoingDone9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DoingDone9/subscriptions","organizations_url":"https://api.github.com/users/DoingDone9/orgs","repos_url":"https://api.github.com/users/DoingDone9/repos","events_url":"https://api.github.com/users/DoingDone9/events{/privacy}","received_events_url":"https://api.github.com/users/DoingDone9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":37,"created_at":"2015-05-22T10:08:15Z","updated_at":"2015-06-12T00:01:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/6351","html_url":"https://github.com/apache/spark/pull/6351","diff_url":"https://github.com/apache/spark/pull/6351.diff","patch_url":"https://github.com/apache/spark/pull/6351.patch"},"body":"SQL\r\n```\r\nselect * from tableA join tableB on (a > 3 and b = d) or (a > 3 and b = e)\r\n```\r\nPlan before modify\r\n```\r\n== Optimized Logical Plan ==\r\nProject [a#293,b#294,c#295,d#296,e#297]\r\n Join Inner, Some(((a#293 > 3) && ((b#294 = d#296) || (b#294 = e#297))))\r\n  MetastoreRelation default, tablea, None\r\n  MetastoreRelation default, tableb, None\r\n```\r\nPlan after modify\r\n```\r\n== Optimized Logical Plan ==\r\nProject [a#293,b#294,c#295,d#296,e#297]\r\n Join Inner, Some(((b#294 = d#296) || (b#294 = e#297)))\r\n  Filter (a#293 > 3)\r\n   MetastoreRelation default, tablea, None\r\n  MetastoreRelation default, tableb, None\r\n```\r\n\r\nCombineLimits ==> Limit(If(LessThan(ne, le), ne, le), grandChild) and LessThan is in BooleanSimplification ,  so CombineLimits  must before BooleanSimplification and BooleanSimplification must before PushPredicateThroughJoin.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/111309649","html_url":"https://github.com/apache/spark/pull/6351#issuecomment-111309649","issue_url":"https://api.github.com/repos/apache/spark/issues/6351","id":111309649,"user":{"login":"marmbrus","id":527,"avatar_url":"https://avatars.githubusercontent.com/u/527?v=3","gravatar_id":"","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},"created_at":"2015-06-12T00:01:46Z","updated_at":"2015-06-12T00:01:46Z","body":"Thanks!  Merged to master."}}