[ 
https://issues.apache.org/jira/browse/HCATALOG-567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13531886#comment-13531886
 ] 

Mithun Radhakrishnan commented on HCATALOG-567:
-----------------------------------------------

There's a pretty serious bug in the implementation of addPartitions() and 
dropPartition() today. Consider the following code from HCatClientHMSImpl:

{code:borderStyle=solid}
@Override
public void dropPartition(String dbName, String tableName, Map<String, String> 
partitionSpec, boolean ifExists)
        throws HCatException {
        try {
            List<String> ptnValues = new ArrayList<String>();
            ptnValues.addAll(partitionSpec.values());
            hmsClient.dropPartition(checkDB(dbName), tableName, ptnValues,
                ifExists);
{code}

{{partitionSpec.values()}} returns part-values in an implementation-specific 
order that needn't be in the order of partition-keys (as specified in the 
Table's partitioning schema). E.g. partitionSpec could be a HashMap, TreeMap or 
LinkedHashMap.

I'll be fixing this as part of this JIRA, while modifying dropPartition() to 
dropPartitions() (i.e. to support partial partition specifications, and thus 
drop more than one partition if required.)
                
> HCatClient must allow retrieval of multiple partitions using a partial 
> partition spec.
> --------------------------------------------------------------------------------------
>
>                 Key: HCATALOG-567
>                 URL: https://issues.apache.org/jira/browse/HCATALOG-567
>             Project: HCatalog
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.5, 0.4.1
>            Reporter: Mithun Radhakrishnan
>             Fix For: 0.5, 0.4.1
>
>
> HCatClient has only one partition-getter function that accepts a 
> partition-spec (Map<String, String> ), and that method assumes that at most 
> one partition matches the specification. (i.e. It assumes that the 
> partition-spec is complete.)
> HCatClient must provide a way to retrieve all partitions that match a partial 
> partition spec.
> public List<HCatPartition> getPartitions(String dbName, String tableName, 
> Map<String, String> partitionSpec);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to