Search in sources :

Example 1 with DropPartitionsRequest

use of org.apache.hadoop.hive.metastore.api.DropPartitionsRequest in project metacat by Netflix.

the class MetacatHiveClient method dropHivePartitions.

private void dropHivePartitions(final HiveMetastoreClient client, final String dbName, final String tableName, final List<String> partitionNames) throws TException {
    if (partitionNames != null && !partitionNames.isEmpty()) {
        final DropPartitionsRequest request = new DropPartitionsRequest(dbName, tableName, new RequestPartsSpec(RequestPartsSpec._Fields.NAMES, partitionNames));
        request.setDeleteData(false);
        client.drop_partitions_req(request);
    }
}
Also used : RequestPartsSpec(org.apache.hadoop.hive.metastore.api.RequestPartsSpec) DropPartitionsRequest(org.apache.hadoop.hive.metastore.api.DropPartitionsRequest)

Aggregations

DropPartitionsRequest (org.apache.hadoop.hive.metastore.api.DropPartitionsRequest)1 RequestPartsSpec (org.apache.hadoop.hive.metastore.api.RequestPartsSpec)1