use of com.amazonaws.services.glue.model.UpdateDatabaseRequest in project presto by prestodb.
the class GlueHiveMetastore method renameDatabase.
@Override
public void renameDatabase(MetastoreContext metastoreContext, String databaseName, String newDatabaseName) {
try {
Database database = getDatabase(metastoreContext, databaseName).orElseThrow(() -> new SchemaNotFoundException(databaseName));
DatabaseInput renamedDatabase = GlueInputConverter.convertDatabase(database).withName(newDatabaseName);
stats.getUpdateDatabase().record(() -> glueClient.updateDatabase(new UpdateDatabaseRequest().withCatalogId(catalogId).withName(databaseName).withDatabaseInput(renamedDatabase)));
} catch (AmazonServiceException e) {
throw new PrestoException(HIVE_METASTORE_ERROR, e);
}
}
Aggregations