{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/6537","labels_url":"https://api.github.com/repos/apache/spark/issues/6537/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/6537/comments","events_url":"https://api.github.com/repos/apache/spark/issues/6537/events","html_url":"https://github.com/apache/spark/pull/6537","id":83054708,"number":6537,"title":"[SQL] Simplifies binary node pattern matching","user":{"login":"liancheng","id":230655,"avatar_url":"https://avatars.githubusercontent.com/u/230655?v=3","gravatar_id":"","url":"https://api.github.com/users/liancheng","html_url":"https://github.com/liancheng","followers_url":"https://api.github.com/users/liancheng/followers","following_url":"https://api.github.com/users/liancheng/following{/other_user}","gists_url":"https://api.github.com/users/liancheng/gists{/gist_id}","starred_url":"https://api.github.com/users/liancheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liancheng/subscriptions","organizations_url":"https://api.github.com/users/liancheng/orgs","repos_url":"https://api.github.com/users/liancheng/repos","events_url":"https://api.github.com/users/liancheng/events{/privacy}","received_events_url":"https://api.github.com/users/liancheng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-05-31T10:03:49Z","updated_at":"2015-06-01T15:32:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/6537","html_url":"https://github.com/apache/spark/pull/6537","diff_url":"https://github.com/apache/spark/pull/6537.diff","patch_url":"https://github.com/apache/spark/pull/6537.patch"},"body":"This PR is a simpler version of #2764, and adds `unapply` methods to the following binary nodes for simpler pattern matching:\r\n\r\n- `BinaryExpression`\r\n- `BinaryComparison`\r\n- `BinaryArithmetics`\r\n\r\nThis enables nested pattern matching for binary nodes. For example, the following pattern matching\r\n\r\n```scala\r\ncase p: BinaryComparison if p.left.dataType == StringType &&\r\n                            p.right.dataType == DateType =>\r\n  p.makeCopy(Array(p.left, Cast(p.right, StringType)))\r\n```\r\n\r\ncan be simplified to\r\n\r\n```scala\r\ncase p @ BinaryComparison(l @ StringType(), r @ DateType()) =>\r\n  p.makeCopy(Array(l, Cast(r, StringType)))\r\n```"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/107586352","html_url":"https://github.com/apache/spark/pull/6537#issuecomment-107586352","issue_url":"https://api.github.com/repos/apache/spark/issues/6537","id":107586352,"user":{"login":"AmplabJenkins","id":4031291,"avatar_url":"https://avatars.githubusercontent.com/u/4031291?v=3","gravatar_id":"","url":"https://api.github.com/users/AmplabJenkins","html_url":"https://github.com/AmplabJenkins","followers_url":"https://api.github.com/users/AmplabJenkins/followers","following_url":"https://api.github.com/users/AmplabJenkins/following{/other_user}","gists_url":"https://api.github.com/users/AmplabJenkins/gists{/gist_id}","starred_url":"https://api.github.com/users/AmplabJenkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmplabJenkins/subscriptions","organizations_url":"https://api.github.com/users/AmplabJenkins/orgs","repos_url":"https://api.github.com/users/AmplabJenkins/repos","events_url":"https://api.github.com/users/AmplabJenkins/events{/privacy}","received_events_url":"https://api.github.com/users/AmplabJenkins/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T15:32:11Z","updated_at":"2015-06-01T15:32:11Z","body":" Merged build triggered."}}