Skip to content

Commit

Permalink
Add default value of Glue GetPartitions MaxResults
Browse files Browse the repository at this point in the history
  • Loading branch information
Istvan authored and sopel39 committed Mar 11, 2020
1 parent bbeac7f commit 4f22b0e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,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> PARTITION_COMPARATOR =
comparing(Partition::getValues, lexicographical(String.CASE_INSENSITIVE_ORDER));

Expand Down Expand Up @@ -749,7 +750,8 @@ private List<Partition> 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();
Expand Down

0 comments on commit 4f22b0e

Please sign in to comment.