From b0d2341e9e2c498764821939063f0a7825efd975 Mon Sep 17 00:00:00 2001 From: Moriarty <22225248+apmoriarty@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:03:58 +0000 Subject: [PATCH] guard against empty ranges --- src/main/java/datawave/query/util/MetadataHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/datawave/query/util/MetadataHelper.java b/src/main/java/datawave/query/util/MetadataHelper.java index 931e236..c8189c6 100644 --- a/src/main/java/datawave/query/util/MetadataHelper.java +++ b/src/main/java/datawave/query/util/MetadataHelper.java @@ -1594,6 +1594,10 @@ public Map getCountsForFieldsInDateRange(Set fields, Set fieldCounts = new HashMap<>(); Set ranges = createFieldCountRanges(fields, sortedDatatypes, beginDate, endDate); + if (ranges.isEmpty()) { + return fieldCounts; + } + try (BatchScanner bs = ScannerHelper.createBatchScanner(accumuloClient, getMetadataTableName(), getAuths(), fields.size())) { bs.setRanges(ranges);