List of usage examples for com.amazonaws.services.glue.model GetPartitionsResult getNextToken
public String getNextToken()
A continuation token, if the returned list of partitions does not include the last one.
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 {/*from ww w.jav a 2s . 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); } }