mirror of https://github.com/apache/druid.git
avoid creating mergeSeqence when not required
This commit is contained in:
parent
b33c644da0
commit
1a46c4c71c
|
@ -19,6 +19,7 @@ package io.druid.query;
|
|||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.metamx.common.guava.Sequence;
|
||||
import com.metamx.common.guava.Sequences;
|
||||
|
@ -90,9 +91,11 @@ public class RetryQueryRunner<T> implements QueryRunner<T>
|
|||
if (!config.isReturnPartialResults() && !finalMissingSegs.isEmpty()) {
|
||||
throw new SegmentMissingException("No results found for segments[%s]", finalMissingSegs);
|
||||
}
|
||||
return toolChest.mergeSequencesUnordered(Sequences.simple(listOfSequences)).toYielder(initValue, accumulator);
|
||||
}
|
||||
else {
|
||||
return Iterables.getOnlyElement(listOfSequences).toYielder(initValue, accumulator);
|
||||
}
|
||||
|
||||
return toolChest.mergeSequencesUnordered(Sequences.simple(listOfSequences)).toYielder(initValue, accumulator);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue