Skip to content

Commit 6c65744

Browse files
committed
Move nulls check and add test for those cases
1 parent 8555c16 commit 6c65744

File tree

81 files changed

+192
-879
lines changed

Some content is hidden

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

81 files changed

+192
-879
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ private MethodSpec addRawInputLoop(TypeName groupsType, TypeName valuesType) {
412412
builder.beginControlFlow("for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++)");
413413
{
414414
if (groupsIsBlock) {
415-
builder.beginControlFlow("if (groups.isNull(groupPosition))");
415+
if (valuesIsBlock) {
416+
builder.beginControlFlow("if (groups.isNull(groupPosition) || values.isNull(groupPosition + positionOffset))");
417+
} else {
418+
builder.beginControlFlow("if (groups.isNull(groupPosition))");
419+
}
416420
builder.addStatement("continue");
417421
builder.endControlFlow();
418422
builder.addStatement("int groupStart = groups.getFirstValueIndex(groupPosition)");
@@ -430,9 +434,6 @@ private MethodSpec addRawInputLoop(TypeName groupsType, TypeName valuesType) {
430434
}
431435

432436
if (valuesIsBlock) {
433-
builder.beginControlFlow("if (values.isNull(groupPosition + positionOffset))");
434-
builder.addStatement("continue");
435-
builder.endControlFlow();
436437
builder.addStatement("int valuesStart = values.getFirstValueIndex(groupPosition + positionOffset)");
437438
builder.addStatement("int valuesEnd = valuesStart + values.getValueCount(groupPosition + positionOffset)");
438439
if (aggParam.isArray()) {

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

Lines changed: 2 additions & 11 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: 2 additions & 11 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: 2 additions & 11 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: 2 additions & 11 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: 2 additions & 11 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: 2 additions & 11 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: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)