in aws-glue-datacatalog-client-common/src/main/java/com/amazonaws/glue/catalog/metastore/GlueMetastoreClientDelegate.java [846:879]
public boolean dropPartition(
String dbName,
String tblName,
List<String>values,
boolean ifExist,
boolean deleteData,
boolean purgeData
) throws TException {
checkArgument(StringUtils.isNotEmpty(dbName), "dbName cannot be null or empty");
checkArgument(StringUtils.isNotEmpty(tblName), "tblName cannot be null or empty");
checkNotNull(values, "values cannot be null");
org.apache.hadoop.hive.metastore.api.Partition partition = null;
try {
partition = getPartition(dbName, tblName, values);
} catch (NoSuchObjectException e) {
if (ifExist) {
return true;
}
}
try {
glueMetastore.deletePartition(dbName, tblName, partition.getValues());
} catch (AmazonServiceException e) {
throw CatalogToHiveConverter.wrapInHiveException(e);
} catch (Exception e) {
String msg = "Unable to drop partition with values: " + StringUtils.join(values, "/");
logger.error(msg, e);
throw new MetaException(msg + e);
}
performDropPartitionPostProcessing(dbName, tblName, partition, deleteData, purgeData);
return true;
}