Skip to content

Commit 6cb6ac9

Browse files
committed
Fix empty VALUES with ordinals grouping (elastic#130861)
We should not build the sorted structure for the ordinal grouping operator if the requested position is larger than maxGroupId. This situation occurs with nulls. We should benchmark the ordinal blocks and consider removing the ordinal grouping operator if performance is similar; otherwise, we need to integrate this operator with GroupingAggregatorFunctionTestCase. Relates elastic#130576 (cherry picked from commit f58d291)
1 parent e16f459 commit 6cb6ac9

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregator.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesDoubleAggregator.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesFloatAggregator.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesIntAggregator.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/ValuesLongAggregator.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-ValuesAggregator.java.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ $endif$
104104
}
105105

106106
public static void combineStates(GroupingState current, int currentGroupId, GroupingState state, int statePosition) {
107-
var sorted = state.sortedForOrdinalMerging(current);
108107
if (statePosition > state.maxGroupId) {
109108
return;
110109
}
110+
var sorted = state.sortedForOrdinalMerging(current);
111111
var start = statePosition > 0 ? sorted.counts[statePosition - 1] : 0;
112112
var end = sorted.counts[statePosition];
113113
for (int i = start; i < end; i++) {

0 commit comments

Comments
 (0)