Skip to content

Commit fac0892

Browse files
committed
Update trivial tests
1 parent 025d992 commit fac0892

File tree

100 files changed

+220
-217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+220
-217
lines changed

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/OperatorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ public String toString() {
197197
ElementType.BYTES_REF,
198198
0,
199199
gField,
200-
List.of(CountAggregatorFunction.supplier(List.of(1)).groupingAggregatorFactory(INITIAL)),
200+
List.of(CountAggregatorFunction.supplier().groupingAggregatorFactory(INITIAL, List.of(1))),
201201
randomPageSize(),
202202
driverContext
203203
)
204204
);
205205
operators.add(
206206
new HashAggregationOperator(
207-
List.of(CountAggregatorFunction.supplier(List.of(1, 2)).groupingAggregatorFactory(FINAL)),
207+
List.of(CountAggregatorFunction.supplier().groupingAggregatorFactory(FINAL, List.of(1, 2))),
208208
() -> BlockHash.build(
209209
List.of(new BlockHash.GroupSpec(0, ElementType.BYTES_REF)),
210210
driverContext.blockFactory(),

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/AggregatorFunctionTestCase.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
import static org.hamcrest.Matchers.hasSize;
4848

4949
public abstract class AggregatorFunctionTestCase extends ForkingOperatorTestCase {
50-
protected abstract AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels);
50+
protected abstract AggregatorFunctionSupplier aggregatorFunction();
5151

5252
protected final int aggregatorIntermediateBlockCount() {
53-
try (var agg = aggregatorFunction(List.of()).aggregator(driverContext())) {
53+
try (var agg = aggregatorFunction().aggregator(driverContext(), List.of())) {
5454
return agg.intermediateBlockCount();
5555
}
5656
}
@@ -69,8 +69,8 @@ private Operator.OperatorFactory simpleWithMode(
6969
Function<AggregatorFunctionSupplier, AggregatorFunctionSupplier> wrap
7070
) {
7171
List<Integer> channels = mode.isInputPartial() ? range(0, aggregatorIntermediateBlockCount()).boxed().toList() : List.of(0);
72-
AggregatorFunctionSupplier supplier = aggregatorFunction(channels);
73-
Aggregator.Factory factory = wrap.apply(supplier).aggregatorFactory(mode);
72+
AggregatorFunctionSupplier supplier = aggregatorFunction();
73+
Aggregator.Factory factory = wrap.apply(supplier).aggregatorFactory(mode, channels);
7474
return new AggregationOperator.AggregationOperatorFactory(List.of(factory), mode);
7575
}
7676

@@ -224,7 +224,7 @@ public void testSomeFiltered() {
224224
// Returns an intermediate state that is equivalent to what the local execution planner will emit
225225
// if it determines that certain shards have no relevant data.
226226
List<Page> nullIntermediateState(BlockFactory blockFactory) {
227-
try (var agg = aggregatorFunction(List.of()).aggregator(driverContext())) {
227+
try (var agg = aggregatorFunction().aggregator(driverContext(), List.of())) {
228228
var method = agg.getClass().getMethod("intermediateStateDesc");
229229
@SuppressWarnings("unchecked")
230230
List<IntermediateStateDesc> intermediateStateDescs = (List<IntermediateStateDesc>) method.invoke(null);

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ protected SourceOperator simpleInput(BlockFactory blockFactory, int size) {
2626
}
2727

2828
@Override
29-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
30-
return CountAggregatorFunction.supplier(inputChannels);
29+
protected AggregatorFunctionSupplier aggregatorFunction() {
30+
return CountAggregatorFunction.supplier();
3131
}
3232

3333
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctBooleanAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ protected SourceOperator simpleInput(BlockFactory blockFactory, int size) {
2626
}
2727

2828
@Override
29-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
30-
return new CountDistinctBooleanAggregatorFunctionSupplier(inputChannels);
29+
protected AggregatorFunctionSupplier aggregatorFunction() {
30+
return new CountDistinctBooleanAggregatorFunctionSupplier();
3131
}
3232

3333
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctBooleanGroupingAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
public class CountDistinctBooleanGroupingAggregatorFunctionTests extends GroupingAggregatorFunctionTestCase {
2626

2727
@Override
28-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
29-
return new CountDistinctBooleanAggregatorFunctionSupplier(inputChannels);
28+
protected AggregatorFunctionSupplier aggregatorFunction() {
29+
return new CountDistinctBooleanAggregatorFunctionSupplier();
3030
}
3131

3232
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctBytesRefAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ protected SourceOperator simpleInput(BlockFactory blockFactory, int size) {
3232
}
3333

3434
@Override
35-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
36-
return new CountDistinctBytesRefAggregatorFunctionSupplier(inputChannels, 40000);
35+
protected AggregatorFunctionSupplier aggregatorFunction() {
36+
return new CountDistinctBytesRefAggregatorFunctionSupplier(40000);
3737
}
3838

3939
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctBytesRefGroupingAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
public class CountDistinctBytesRefGroupingAggregatorFunctionTests extends GroupingAggregatorFunctionTestCase {
2828

2929
@Override
30-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
31-
return new CountDistinctBytesRefAggregatorFunctionSupplier(inputChannels, 40000);
30+
protected AggregatorFunctionSupplier aggregatorFunction() {
31+
return new CountDistinctBytesRefAggregatorFunctionSupplier(40000);
3232
}
3333

3434
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctDoubleAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ protected SourceOperator simpleInput(BlockFactory blockFactory, int size) {
2828
}
2929

3030
@Override
31-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
32-
return new CountDistinctDoubleAggregatorFunctionSupplier(inputChannels, 40000);
31+
protected AggregatorFunctionSupplier aggregatorFunction() {
32+
return new CountDistinctDoubleAggregatorFunctionSupplier(40000);
3333
}
3434

3535
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctDoubleGroupingAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
public class CountDistinctDoubleGroupingAggregatorFunctionTests extends GroupingAggregatorFunctionTestCase {
2727

2828
@Override
29-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
30-
return new CountDistinctDoubleAggregatorFunctionSupplier(inputChannels, 40000);
29+
protected AggregatorFunctionSupplier aggregatorFunction() {
30+
return new CountDistinctDoubleAggregatorFunctionSupplier(40000);
3131
}
3232

3333
@Override

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/CountDistinctFloatAggregatorFunctionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ protected SourceOperator simpleInput(BlockFactory blockFactory, int size) {
2828
}
2929

3030
@Override
31-
protected AggregatorFunctionSupplier aggregatorFunction(List<Integer> inputChannels) {
32-
return new CountDistinctFloatAggregatorFunctionSupplier(inputChannels, 40000);
31+
protected AggregatorFunctionSupplier aggregatorFunction() {
32+
return new CountDistinctFloatAggregatorFunctionSupplier(40000);
3333
}
3434

3535
@Override

0 commit comments

Comments
 (0)