List of usage examples for com.amazonaws.services.glue.model GetPartitionsResult getPartitions
public java.util.List<Partition> getPartitions()
A list of requested partitions.
From source file:com.facebook.presto.hive.metastore.glue.GlueHiveMetastore.java
License:Apache License
private List<Partition> getPartitions(String databaseName, String tableName, String expression) { try {//w w w . j a v a2s.co m List<Partition> partitions = new ArrayList<>(); String nextToken = null; do { GetPartitionsResult result = glueClient .getPartitions(new GetPartitionsRequest().withDatabaseName(databaseName) .withTableName(tableName).withExpression(expression).withNextToken(nextToken)); result.getPartitions() .forEach(partition -> partitions.add(GlueToPrestoConverter.convertPartition(partition))); nextToken = result.getNextToken(); } while (nextToken != null); return partitions; } catch (AmazonServiceException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }