diff --git a/presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java b/presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java index 69954bf982a8..10ae8682e7b8 100644 --- a/presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java +++ b/presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java @@ -147,6 +147,7 @@ public class GlueHiveMetastore private static final String WILDCARD_EXPRESSION = ""; private static final int BATCH_GET_PARTITION_MAX_PAGE_SIZE = 1000; private static final int BATCH_CREATE_PARTITION_MAX_PAGE_SIZE = 100; + private static final int AWS_GLUE_GET_PARTITIONS_MAX_RESULTS = 128; private static final Comparator PARTITION_COMPARATOR = comparing(Partition::getValues, lexicographical(String.CASE_INSENSITIVE_ORDER)); @@ -747,7 +748,8 @@ private List getPartitions(Table table, String expression, @Nullable .withTableName(table.getTableName()) .withExpression(expression) .withSegment(segment) - .withNextToken(nextToken)); + .withNextToken(nextToken) + .withMaxResults(AWS_GLUE_GET_PARTITIONS_MAX_RESULTS)); result.getPartitions() .forEach(partition -> partitions.add(GlueToPrestoConverter.convertPartition(partition, table.getParameters()))); nextToken = result.getNextToken();