This commit is contained in:
parent
8841779de8
commit
7114fe786b
|
@ -526,6 +526,9 @@ public final class InternalAutoDateHistogram extends
|
||||||
if (buckets.size() > targetBuckets) {
|
if (buckets.size() > targetBuckets) {
|
||||||
for (int interval : roundingInfo.innerIntervals) {
|
for (int interval : roundingInfo.innerIntervals) {
|
||||||
int resultingBuckets = buckets.size() / interval;
|
int resultingBuckets = buckets.size() / interval;
|
||||||
|
if (buckets.size() % interval != 0) {
|
||||||
|
resultingBuckets++;
|
||||||
|
}
|
||||||
if (resultingBuckets <= targetBuckets) {
|
if (resultingBuckets <= targetBuckets) {
|
||||||
return mergeConsecutiveBuckets(buckets, interval, roundingIdx, roundingInfo, reduceContext);
|
return mergeConsecutiveBuckets(buckets, interval, roundingIdx, roundingInfo, reduceContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,10 +108,7 @@ public class InternalAutoDateHistogramTests extends InternalMultiBucketAggregati
|
||||||
assertThat(result, equalTo(2));
|
assertThat(result, equalTo(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/39497")
|
|
||||||
// TODO: When resolving the above AwaitsFix, just delete this override. Method is only overriden to apply the annotation.
|
|
||||||
public void testReduceRandom() {
|
public void testReduceRandom() {
|
||||||
super.testReduceRandom();
|
super.testReduceRandom();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue