diff --git a/presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/glue/GlueHiveMetastore.java b/presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/glue/GlueHiveMetastore.java index 9c03f60971fe8..7fe2ec8505d73 100644 --- a/presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/glue/GlueHiveMetastore.java +++ b/presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/glue/GlueHiveMetastore.java @@ -150,6 +150,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 = 1000; private static final Comparator PARTITION_COMPARATOR = comparing(Partition::getValues, lexicographical(String.CASE_INSENSITIVE_ORDER)); private final GlueMetastoreStats stats = new GlueMetastoreStats(); @@ -750,7 +751,8 @@ private List getPartitions(String databaseName, String tableName, Str .withDatabaseName(databaseName) .withTableName(tableName) .withExpression(expression) - .withSegment(segment); + .withSegment(segment) + .withMaxResults(AWS_GLUE_GET_PARTITIONS_MAX_RESULTS); do { GetPartitionsResult result = stats.getGetPartitions().record(() -> glueClient.getPartitions(request));