GitHub user jiangxb1987 opened a pull request:

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

    [SPARK-22214][SQL] Refactor the list hive partitions code

    ## What changes were proposed in this pull request?
    
    In this PR we make a few changes to the list hive partitions code, to make 
the code more extensible.
    The following changes are made:
    1. In `HiveClientImpl.getPartitions()`, call `client.getPartitions` instead 
of `shim.getAllPartitions` when `spec` is empty;
    2. In `HiveTableScanExec`, previously we always call 
`listPartitionsByFilter` if the config `metastorePartitionPruning` is enabled, 
but actually, we'd better call `listPartitions` if `partitionPruningPred` is 
empty;
    3.  We should use sessionCatalog instead of SharedState.externalCatalog in 
`HiveTableScanExec`.
    
    ## How was this patch tested?
    
    Tested by existing test cases since this is code refactor, no regression or 
behavior change is expected.

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

    $ git pull https://github.com/jiangxb1987/spark hivePartitions

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

    https://github.com/apache/spark/pull/19444.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 #19444
    
----
commit 8f50c7c47934a8dca662e8e2d5eacbc0b394eaa5
Author: Xingbo Jiang <xingbo.ji...@databricks.com>
Date:   2017-10-06T11:04:29Z

    refactor list hive partitions.

----


---

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

Reply via email to