in aws-glue-datacatalog-client-common/src/main/java/com/amazonaws/glue/catalog/metastore/GlueMetastoreClientDelegate.java [923:951]
public void alterPartitions(
String dbName,
String tblName,
List<org.apache.hadoop.hive.metastore.api.Partition> partitions
) throws TException {
checkArgument(StringUtils.isNotEmpty(dbName), "dbName cannot be null or empty");
checkArgument(StringUtils.isNotEmpty(tblName), "tblName cannot be null or empty");
checkNotNull(partitions, "partitions cannot be null");
for (org.apache.hadoop.hive.metastore.api.Partition part : partitions) {
part.setParameters(deepCopyMap(part.getParameters()));
if (part.getParameters().get(hive_metastoreConstants.DDL_TIME) == null ||
Integer.parseInt(part.getParameters().get(hive_metastoreConstants.DDL_TIME)) == 0) {
part.putToParameters(hive_metastoreConstants.DDL_TIME, Long.toString(System.currentTimeMillis() / MILLISECOND_TO_SECOND_FACTOR));
}
PartitionInput partitionInput = GlueInputConverter.convertToPartitionInput(part);
try {
glueMetastore.updatePartition(dbName, tblName, part.getValues(), partitionInput);
} catch (AmazonServiceException e) {
throw CatalogToHiveConverter.wrapInHiveException(e);
} catch (Exception e) {
String msg = "Unable to alter partition: ";
logger.error(msg, e);
throw new MetaException(msg + e);
}
}
}