GitHub user adrian-ionescu opened a pull request:

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

    [SPARK-20194] Add support for partition pruning to in-memory catalog

    ## What changes were proposed in this pull request?
    This patch implements `listPartitionsByFilter()` for `InMemoryCatalog` and 
thus resolves an outstanding TODO causing the `PruneFileSourcePartitions` 
optimizer rule not to apply when "spark.sql.catalogImplementation" is set to 
"in-memory" (which is the default).
    
    The change is straightforward: it extracts the code for further filtering 
of the list of partitions returned by the metastore's `getPartitionsByFilter()` 
out from `HiveExternalCatalog` into `ExternalCatalogUtils` and calls this new 
function from `InMemoryCatalog` on the whole list of partitions.
    
    Now that this method is implemented we can always pass the `CatalogTable` 
to the `DataSource` in `FindDataSourceTable`, so that the latter is resolved to 
a relation with a `CatalogFileIndex`, which is what the 
`PruneFileSourcePartitions` rule matches for.
    
    ## How was this patch tested?
    Ran existing tests and added new test for `listPartitionsByFilter` in 
`ExternalCatalogSuite`, which is subclassed by both `InMemoryCatalogSuite` and 
`HiveExternalCatalogSuite`.


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

    $ git pull https://github.com/adrian-ionescu/apache-spark InMemoryCatalog

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

    https://github.com/apache/spark/pull/17510.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 #17510
    
----
commit 3b031c75ba35324242993e8742961d23ce087445
Author: Adrian Ionescu <adr...@databricks.com>
Date:   2017-04-02T13:01:41Z

    Implement listPartitionsByFilter() for InMemoryCatalog

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to