Example usage for com.amazonaws.services.glue.model GetDatabaseResult getDatabase

List of usage examples for com.amazonaws.services.glue.model GetDatabaseResult getDatabase

Introduction

In this page you can find the example usage for com.amazonaws.services.glue.model GetDatabaseResult getDatabase.

Prototype


public Database getDatabase() 

Source Link

Document

The definition of the specified database in the Data Catalog.

Usage

From source file:com.facebook.presto.hive.metastore.glue.GlueHiveMetastore.java

License:Apache License

@Override
public Optional<Database> getDatabase(String databaseName) {
    try {/*from   ww  w .j a  v  a  2s  .  c o  m*/
        GetDatabaseResult result = glueClient.getDatabase(new GetDatabaseRequest().withName(databaseName));
        return Optional.of(GlueToPrestoConverter.convertDatabase(result.getDatabase()));
    } catch (EntityNotFoundException e) {
        return Optional.empty();
    } catch (AmazonServiceException e) {
        throw new PrestoException(HIVE_METASTORE_ERROR, e);
    }
}