throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
if (parts.isEmpty()) {
return needResults ? new ArrayList<Partition>() : null;
}
Partition part = parts.get(0);
AddPartitionsRequest req = new AddPartitionsRequest(
part.getDbName(), part.getTableName(), parts, ifNotExists);
req.setNeedResult(needResults);
AddPartitionsResult result = client.add_partitions_req(req);
return needResults ? filterHook.filterPartitions(result.getPartitions()) : null;
}