Example usage for com.amazonaws.services.glue.model GetTableResult getTable

List of usage examples for com.amazonaws.services.glue.model GetTableResult getTable

Introduction

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

Prototype


public Table getTable() 

Source Link

Document

The Table object that defines the specified table.

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 {/*  w w w.ja va 2 s  .c  om*/
        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);
    }
}