Skip to content

Commit ee8ad69

Browse files
committed
Restore null check for vector groups with block values
1 parent d482cd2 commit ee8ad69

File tree

79 files changed

+243
-6
lines changed

Some content is hidden

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

79 files changed

+243
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import java.util.Arrays;
2424
import java.util.List;
25+
import java.util.Objects;
2526
import java.util.function.Consumer;
2627
import java.util.function.Function;
2728
import java.util.stream.Collectors;
@@ -411,14 +412,16 @@ private MethodSpec addRawInputLoop(TypeName groupsType, TypeName valuesType) {
411412

412413
builder.beginControlFlow("for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++)");
413414
{
414-
if (groupsIsBlock) {
415-
if (valuesIsBlock) {
416-
builder.beginControlFlow("if (groups.isNull(groupPosition) || values.isNull(groupPosition + positionOffset))");
417-
} else {
418-
builder.beginControlFlow("if (groups.isNull(groupPosition))");
419-
}
415+
if (groupsIsBlock || valuesIsBlock) {
416+
String conditions = Stream.of(
417+
groupsIsBlock ? "groups.isNull(groupPosition)" : null,
418+
valuesIsBlock ? "values.isNull(groupPosition + positionOffset)" : null
419+
).filter(Objects::nonNull).collect(Collectors.joining(" || "));
420+
builder.beginControlFlow("if (" + conditions + ")");
420421
builder.addStatement("continue");
421422
builder.endControlFlow();
423+
}
424+
if (groupsIsBlock) {
422425
builder.addStatement("int groupStart = groups.getFirstValueIndex(groupPosition)");
423426
builder.addStatement("int groupEnd = groupStart + groups.getValueCount(groupPosition)");
424427
builder.beginControlFlow("for (int g = groupStart; g < groupEnd; g++)");

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

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/CountDistinctBytesRefGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/CountDistinctDoubleGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/CountDistinctFloatGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/CountDistinctIntGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/CountDistinctLongGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/FirstOverTimeDoubleGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/FirstOverTimeFloatGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
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/org/elasticsearch/compute/aggregation/FirstOverTimeIntGroupingAggregatorFunction.java

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)