Skip to content

Commit 00d6d78

Browse files
committed
Add hasVector method to Argument
1 parent 1e7f784 commit 00d6d78

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public AggregatorImplementer(
122122
}).filter(a -> a instanceof PositionArgument == false).toList();
123123

124124
this.tryToUseVectors = aggParams.stream().anyMatch(a -> (a instanceof BlockArgument) == false)
125-
&& aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.dataType(false) == null);
125+
&& aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.hasVector() == false);
126126

127127
this.createParameters = init.getParameters()
128128
.stream()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public EvaluatorImplementer(
7373
this.processOutputsMultivalued = this.processFunction.hasBlockType;
7474
boolean anyParameterNotSupportingVectors = this.processFunction.args.stream()
7575
.filter(a -> a instanceof FixedArgument == false && a instanceof PositionArgument == false)
76-
.anyMatch(a -> a.dataType(false) == null);
76+
.anyMatch(a -> a.hasVector() == false);
7777
vectorsUnsupported = processOutputsMultivalued || anyParameterNotSupportingVectors;
7878
this.allNullsIsNull = allNullsIsNull;
7979
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public GroupingAggregatorImplementer(
128128
}).filter(a -> a instanceof PositionArgument == false).toList();
129129

130130
this.hasOnlyBlockArguments = this.aggParams.stream().allMatch(a -> a instanceof BlockArgument);
131-
this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.dataType(false) == null);
131+
this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.hasVector() == false);
132132

133133
this.createParameters = init.getParameters()
134134
.stream()

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ default TypeName elementType() {
117117
*/
118118
TypeName dataType(boolean blockStyle);
119119

120+
default boolean hasVector() {
121+
return dataType(false) != null;
122+
}
123+
120124
/**
121125
* The parameter passed to the real evaluation function
122126
*/

0 commit comments

Comments
 (0)