Example usage for com.amazonaws.services.glue.model GetPartitionResult getPartition

List of usage examples for com.amazonaws.services.glue.model GetPartitionResult getPartition

Introduction

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

Prototype


public Partition getPartition() 

Source Link

Document

The requested information, in the form of a Partition object.

Usage

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

License:Apache License

@Override
public Optional<Partition> getPartition(String databaseName, String tableName, List<String> partitionValues) {
    try {//from   ww w.  jav  a2s.c  om
        GetPartitionResult result = glueClient.getPartition(new GetPartitionRequest()
                .withDatabaseName(databaseName).withTableName(tableName).withPartitionValues(partitionValues));
        return Optional.of(GlueToPrestoConverter.convertPartition(result.getPartition()));
    } catch (EntityNotFoundException e) {
        return Optional.empty();
    } catch (AmazonServiceException e) {
        throw new PrestoException(HIVE_METASTORE_ERROR, e);
    }
}