Skip to content

Commit e5ea00a

Browse files
authored
Remove combineValueCount from code generation (elastic#121637)
`combineValueCount` is described as something that might no longer be needed and has zero actual usages. Removing it in order to simplify code generation.
1 parent caa4353 commit e5ea00a

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

x-pack/plugin/esql/compute/ann/src/main/java/org/elasticsearch/compute/ann/Aggregator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
* are ever collected.
3838
* </p>
3939
* <p>
40-
* The generation code will also look for a method called {@code combineValueCount}
41-
* which is called once per received block with a count of values. NOTE: We may
42-
* not need this after we convert AVG into a composite operation.
43-
* </p>
44-
* <p>
4540
* The generation code also looks for the optional methods {@code combineIntermediate}
4641
* and {@code evaluateFinal} which are used to combine intermediate states and
4742
* produce the final output. If the first is missing then the generated code will

x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public class AggregatorImplementer {
7878
private final List<TypeMirror> warnExceptions;
7979
private final ExecutableElement init;
8080
private final ExecutableElement combine;
81-
private final ExecutableElement combineValueCount;
8281
private final ExecutableElement combineIntermediate;
8382
private final ExecutableElement evaluateFinal;
8483
private final ClassName implementation;
@@ -115,7 +114,6 @@ public AggregatorImplementer(
115114
TypeName firstParamType = TypeName.get(e.getParameters().get(0).asType());
116115
return firstParamType.isPrimitive() || firstParamType.toString().equals(stateType.toString());
117116
});
118-
this.combineValueCount = findMethod(declarationType, "combineValueCount");
119117
this.combineIntermediate = findMethod(declarationType, "combineIntermediate");
120118
this.evaluateFinal = findMethod(declarationType, "evaluateFinal");
121119
this.createParameters = init.getParameters()
@@ -415,9 +413,6 @@ private MethodSpec addRawVector(boolean masked) {
415413
combineRawInput(builder, "vector");
416414
}
417415
builder.endControlFlow();
418-
if (combineValueCount != null) {
419-
builder.addStatement("$T.combineValueCount(state, vector.getPositionCount())", declarationType);
420-
}
421416
return builder.build();
422417
}
423418

@@ -459,9 +454,6 @@ private MethodSpec addRawBlock(boolean masked) {
459454
}
460455
}
461456
builder.endControlFlow();
462-
if (combineValueCount != null) {
463-
builder.addStatement("$T.combineValueCount(state, block.getTotalValueCount())", declarationType);
464-
}
465457
return builder.build();
466458
}
467459

0 commit comments

Comments
 (0)