File tree Expand file tree Collapse file tree 6 files changed +18
-8
lines changed
x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen Expand file tree Collapse file tree 6 files changed +18
-8
lines changed Original file line number Diff line number Diff 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 . hasVector () == false );
125+ && aggParams .stream ().noneMatch (a -> a . supportsVectorReadAccess () == false );
126126
127127 this .createParameters = init .getParameters ()
128128 .stream ()
Original file line number Diff line number Diff line change 1818import org .elasticsearch .compute .gen .argument .BlockArgument ;
1919import org .elasticsearch .compute .gen .argument .BuilderArgument ;
2020import org .elasticsearch .compute .gen .argument .FixedArgument ;
21- import org .elasticsearch .compute .gen .argument .PositionArgument ;
2221
2322import java .util .ArrayList ;
2423import java .util .List ;
@@ -71,9 +70,7 @@ public EvaluatorImplementer(
7170 declarationType .getSimpleName () + extraName + "Evaluator"
7271 );
7372 this .processOutputsMultivalued = this .processFunction .hasBlockType ;
74- boolean anyParameterNotSupportingVectors = this .processFunction .args .stream ()
75- .filter (a -> a instanceof FixedArgument == false && a instanceof PositionArgument == false )
76- .anyMatch (a -> a .hasVector () == false );
73+ boolean anyParameterNotSupportingVectors = this .processFunction .args .stream ().anyMatch (a -> a .supportsVectorReadAccess () == false );
7774 vectorsUnsupported = processOutputsMultivalued || anyParameterNotSupportingVectors ;
7875 this .allNullsIsNull = allNullsIsNull ;
7976 }
Original file line number Diff line number Diff 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 . hasVector () == false );
131+ this .allArgumentsSupportVectors = aggParams .stream ().noneMatch (a -> a . supportsVectorReadAccess () == false );
132132
133133 this .createParameters = init .getParameters ()
134134 .stream ()
Original file line number Diff line number Diff line change @@ -117,8 +117,11 @@ default TypeName elementType() {
117117 */
118118 TypeName dataType (boolean blockStyle );
119119
120- default boolean hasVector () {
121- return dataType (false ) != null ;
120+ /**
121+ * False if and only if there is a block backing this parameter and that block does not support access as a vector. Otherwise true.
122+ */
123+ default boolean supportsVectorReadAccess () {
124+ return true ;
122125 }
123126
124127 /**
Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ public TypeName dataType(boolean blockStyle) {
3535 return ArrayTypeName .of (vectorType (type ));
3636 }
3737
38+ @ Override
39+ public boolean supportsVectorReadAccess () {
40+ return vectorType (type ) != null ;
41+ }
42+
3843 @ Override
3944 public String paramName (boolean blockStyle ) {
4045 return name + (blockStyle ? "Block" : "Vector" ) + "s" ;
Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ public TypeName dataType(boolean blockStyle) {
3535 return vectorType (type );
3636 }
3737
38+ @ Override
39+ public boolean supportsVectorReadAccess () {
40+ return dataType (false ) != null ;
41+ }
42+
3843 @ Override
3944 public String paramName (boolean blockStyle ) {
4045 return name + (blockStyle ? "Block" : "Vector" );
You can’t perform that action at this time.
0 commit comments