mirror of https://github.com/apache/druid.git
small optimization in timeseries if 'skipEmptyBuckets' is true and cursor completed (#5178)
This commit is contained in:
parent
f18eba50ee
commit
1181411901
|
@ -62,6 +62,10 @@ public class TimeseriesQueryEngine
|
||||||
@Override
|
@Override
|
||||||
public Result<TimeseriesResultValue> apply(Cursor cursor)
|
public Result<TimeseriesResultValue> apply(Cursor cursor)
|
||||||
{
|
{
|
||||||
|
if (skipEmptyBuckets && cursor.isDone()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
Aggregator[] aggregators = new Aggregator[aggregatorSpecs.size()];
|
Aggregator[] aggregators = new Aggregator[aggregatorSpecs.size()];
|
||||||
String[] aggregatorNames = new String[aggregatorSpecs.size()];
|
String[] aggregatorNames = new String[aggregatorSpecs.size()];
|
||||||
|
|
||||||
|
@ -70,10 +74,6 @@ public class TimeseriesQueryEngine
|
||||||
aggregatorNames[i] = aggregatorSpecs.get(i).getName();
|
aggregatorNames[i] = aggregatorSpecs.get(i).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skipEmptyBuckets && cursor.isDone()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (!cursor.isDone()) {
|
while (!cursor.isDone()) {
|
||||||
for (Aggregator aggregator : aggregators) {
|
for (Aggregator aggregator : aggregators) {
|
||||||
|
|
Loading…
Reference in New Issue