Skip to content

Commit

Permalink
guard against empty ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
apmoriarty committed Jun 20, 2024
1 parent 2f6fb0f commit b0d2341
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/datawave/query/util/MetadataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,10 @@ public Map<String,Long> getCountsForFieldsInDateRange(Set<String> fields, Set<St
Map<String,Long> fieldCounts = new HashMap<>();
Set<Range> ranges = createFieldCountRanges(fields, sortedDatatypes, beginDate, endDate);

if (ranges.isEmpty()) {
return fieldCounts;
}

try (BatchScanner bs = ScannerHelper.createBatchScanner(accumuloClient, getMetadataTableName(), getAuths(), fields.size())) {

bs.setRanges(ranges);
Expand Down

0 comments on commit b0d2341

Please sign in to comment.