Example usage for com.amazonaws.services.glue.model GetTableRequest GetTableRequest

List of usage examples for com.amazonaws.services.glue.model GetTableRequest GetTableRequest

Introduction

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

Prototype

GetTableRequest

Source Link

Usage

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

License:Apache License

@Override
public Optional<Table> getTable(String databaseName, String tableName) {
    try {//from w w w . j av  a 2  s. co  m
        GetTableResult result = glueClient
                .getTable(new GetTableRequest().withDatabaseName(databaseName).withName(tableName));
        return Optional.of(GlueToPrestoConverter.convertTable(result.getTable(), databaseName));
    } catch (EntityNotFoundException e) {
        return Optional.empty();
    } catch (AmazonServiceException e) {
        throw new PrestoException(HIVE_METASTORE_ERROR, e);
    }
}