mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-27 17:10:22 -04:00
Merge main into multi-project
This commit is contained in:
commit
04d459009b
758 changed files with 13970 additions and 7318 deletions
|
@ -155,7 +155,7 @@ public class AggregatorBenchmark {
|
|||
|
||||
if (grouping.equals("none")) {
|
||||
return new AggregationOperator(
|
||||
List.of(supplier(op, dataType, filter, 0).aggregatorFactory(AggregatorMode.SINGLE).apply(driverContext)),
|
||||
List.of(supplier(op, dataType, filter).aggregatorFactory(AggregatorMode.SINGLE, List.of(0)).apply(driverContext)),
|
||||
driverContext
|
||||
);
|
||||
}
|
||||
|
@ -182,33 +182,33 @@ public class AggregatorBenchmark {
|
|||
default -> throw new IllegalArgumentException("unsupported grouping [" + grouping + "]");
|
||||
};
|
||||
return new HashAggregationOperator(
|
||||
List.of(supplier(op, dataType, filter, groups.size()).groupingAggregatorFactory(AggregatorMode.SINGLE)),
|
||||
List.of(supplier(op, dataType, filter).groupingAggregatorFactory(AggregatorMode.SINGLE, List.of(groups.size()))),
|
||||
() -> BlockHash.build(groups, driverContext.blockFactory(), 16 * 1024, false),
|
||||
driverContext
|
||||
);
|
||||
}
|
||||
|
||||
private static AggregatorFunctionSupplier supplier(String op, String dataType, String filter, int dataChannel) {
|
||||
private static AggregatorFunctionSupplier supplier(String op, String dataType, String filter) {
|
||||
return filtered(switch (op) {
|
||||
case COUNT -> CountAggregatorFunction.supplier(List.of(dataChannel));
|
||||
case COUNT -> CountAggregatorFunction.supplier();
|
||||
case COUNT_DISTINCT -> switch (dataType) {
|
||||
case LONGS -> new CountDistinctLongAggregatorFunctionSupplier(List.of(dataChannel), 3000);
|
||||
case DOUBLES -> new CountDistinctDoubleAggregatorFunctionSupplier(List.of(dataChannel), 3000);
|
||||
case LONGS -> new CountDistinctLongAggregatorFunctionSupplier(3000);
|
||||
case DOUBLES -> new CountDistinctDoubleAggregatorFunctionSupplier(3000);
|
||||
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
|
||||
};
|
||||
case MAX -> switch (dataType) {
|
||||
case LONGS -> new MaxLongAggregatorFunctionSupplier(List.of(dataChannel));
|
||||
case DOUBLES -> new MaxDoubleAggregatorFunctionSupplier(List.of(dataChannel));
|
||||
case LONGS -> new MaxLongAggregatorFunctionSupplier();
|
||||
case DOUBLES -> new MaxDoubleAggregatorFunctionSupplier();
|
||||
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
|
||||
};
|
||||
case MIN -> switch (dataType) {
|
||||
case LONGS -> new MinLongAggregatorFunctionSupplier(List.of(dataChannel));
|
||||
case DOUBLES -> new MinDoubleAggregatorFunctionSupplier(List.of(dataChannel));
|
||||
case LONGS -> new MinLongAggregatorFunctionSupplier();
|
||||
case DOUBLES -> new MinDoubleAggregatorFunctionSupplier();
|
||||
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
|
||||
};
|
||||
case SUM -> switch (dataType) {
|
||||
case LONGS -> new SumLongAggregatorFunctionSupplier(List.of(dataChannel));
|
||||
case DOUBLES -> new SumDoubleAggregatorFunctionSupplier(List.of(dataChannel));
|
||||
case LONGS -> new SumLongAggregatorFunctionSupplier();
|
||||
case DOUBLES -> new SumDoubleAggregatorFunctionSupplier();
|
||||
default -> throw new IllegalArgumentException("unsupported data type [" + dataType + "]");
|
||||
};
|
||||
default -> throw new IllegalArgumentException("unsupported op [" + op + "]");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue