GitHub user maropu opened a pull request:

    https://github.com/apache/spark/pull/10427

    Implement JdbcRelation#unhandledFilters for removing unnecessary Spark 
Filter

    Input: SELECT * FROM jdbcTable WHERE col0 = 'xxx'
    
    Current plan:
    ```
    == Optimized Logical Plan ==
    Project [col0#0,col1#1]
    +- Filter (col0#0 = xxx)
       +- Relation[col0#0,col1#1] 
JDBCRelation(jdbc:postgresql:postgres,testRel,[Lorg.apache.spark.Partition;@2ac7c683,{user=maropu,
 password=, driver=org.postgresql.Driver})
    
    == Physical Plan ==
    +- Filter (col0#0 = xxx)
       +- 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)]
    ```
    
    This patch enables a plan below;
    ```
    == Optimized Logical Plan ==
    Project [col0#0,col1#1]
    +- Filter (col0#0 = xxx)
       +- Relation[col0#0,col1#1] 
JDBCRelation(jdbc:postgresql:postgres,testRel,[Lorg.apache.spark.Partition;@2ac7c683,{user=maropu,
 password=, driver=org.postgresql.Driver})
    
    == Physical Plan ==
    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)]
    ```


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/maropu/spark RemoveFilterInJdbcScan

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/10427.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #10427
    
----
commit c129f289b02f04b0942a50843dcee733d9e365d8
Author: Takeshi YAMAMURO <[email protected]>
Date:   2015-12-22T00:31:30Z

    Implement JdbcRelation#unhandledFilters

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to