{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/10427","labels_url":"https://api.github.com/repos/apache/spark/issues/10427/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/10427/comments","events_url":"https://api.github.com/repos/apache/spark/issues/10427/events","html_url":"https://github.com/apache/spark/pull/10427","id":123409894,"number":10427,"title":"[SPARK-12476][SQL] Implement JdbcRelation#unhandledFilters for removing unnecessary Spark Filter","user":{"login":"maropu","id":692303,"avatar_url":"https://avatars.githubusercontent.com/u/692303?v=3","gravatar_id":"","url":"https://api.github.com/users/maropu","html_url":"https://github.com/maropu","followers_url":"https://api.github.com/users/maropu/followers","following_url":"https://api.github.com/users/maropu/following{/other_user}","gists_url":"https://api.github.com/users/maropu/gists{/gist_id}","starred_url":"https://api.github.com/users/maropu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maropu/subscriptions","organizations_url":"https://api.github.com/users/maropu/orgs","repos_url":"https://api.github.com/users/maropu/repos","events_url":"https://api.github.com/users/maropu/events{/privacy}","received_events_url":"https://api.github.com/users/maropu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-12-22T04:23:06Z","updated_at":"2015-12-24T04:28:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/10427","html_url":"https://github.com/apache/spark/pull/10427","diff_url":"https://github.com/apache/spark/pull/10427.diff","patch_url":"https://github.com/apache/spark/pull/10427.patch"},"body":"Input: SELECT * FROM jdbcTable WHERE col0 = 'xxx'\r\n\r\nCurrent plan:\r\n```\r\n== Optimized Logical Plan ==\r\nProject [col0#0,col1#1]\r\n+- Filter (col0#0 = xxx)\r\n   +- Relation[col0#0,col1#1] JDBCRelation(jdbc:postgresql:postgres,testRel,[Lorg.apache.spark.Partition;@2ac7c683,{user=maropu, password=, driver=org.postgresql.Driver})\r\n\r\n== Physical Plan ==\r\n+- Filter (col0#0 = xxx)\r\n   +- Scan JDBCRelation(jdbc:postgresql:postgres,testRel,[Lorg.apache.spark.Partition;@2ac7c683,{user=maropu, password=, driver=org.postgresql.Driver})[col0#0,col1#1] PushedFilters: [EqualTo(col0,xxx)]\r\n```\r\n\r\nThis patch enables a plan below;\r\n```\r\n== Optimized Logical Plan ==\r\nProject [col0#0,col1#1]\r\n+- Filter (col0#0 = xxx)\r\n   +- Relation[col0#0,col1#1] JDBCRelation(jdbc:postgresql:postgres,testRel,[Lorg.apache.spark.Partition;@2ac7c683,{user=maropu, password=, driver=org.postgresql.Driver})\r\n\r\n== Physical Plan ==\r\nScan JDBCRelation(jdbc:postgresql:postgres,testRel,[Lorg.apache.spark.Partition;@2ac7c683,{user=maropu, password=, driver=org.postgresql.Driver})[col0#0,col1#1] PushedFilters: [EqualTo(col0,xxx)]\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/167039831","html_url":"https://github.com/apache/spark/pull/10427#issuecomment-167039831","issue_url":"https://api.github.com/repos/apache/spark/issues/10427","id":167039831,"user":{"login":"maropu","id":692303,"avatar_url":"https://avatars.githubusercontent.com/u/692303?v=3","gravatar_id":"","url":"https://api.github.com/users/maropu","html_url":"https://github.com/maropu","followers_url":"https://api.github.com/users/maropu/followers","following_url":"https://api.github.com/users/maropu/following{/other_user}","gists_url":"https://api.github.com/users/maropu/gists{/gist_id}","starred_url":"https://api.github.com/users/maropu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maropu/subscriptions","organizations_url":"https://api.github.com/users/maropu/orgs","repos_url":"https://api.github.com/users/maropu/repos","events_url":"https://api.github.com/users/maropu/events{/privacy}","received_events_url":"https://api.github.com/users/maropu/received_events","type":"User","site_admin":false},"created_at":"2015-12-24T04:28:37Z","updated_at":"2015-12-24T04:28:37Z","body":"If this patch merged, the comment below is not suitable for `JDBCRelation`. \r\nhttps://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/sources/interfaces.scala#L281\r\n\r\nIs it okay to fix it?"}}