Class CompoundOutputEvaluator
java.lang.Object
org.elasticsearch.xpack.esql.evaluator.command.CompoundOutputEvaluator
- All Implemented Interfaces:
ColumnExtractOperator.Evaluator
public final class CompoundOutputEvaluator
extends Object
implements ColumnExtractOperator.Evaluator
The base evaluator that extracts compound output. Subclasses should implement the actual evaluation logic.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic interfacestatic enumstatic interfacestatic classThe base class for output fields collectors.static interfacestatic final classABlock.Builderholder that is being set before each row evaluation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CompoundOutputEvaluator.GeoPointCollectorstatic final ObjIntConsumer<CompoundOutputEvaluator.RowOutput> static final ObjLongConsumer<CompoundOutputEvaluator.RowOutput> static final BiConsumer<CompoundOutputEvaluator.RowOutput, String> -
Method Summary
Modifier and TypeMethodDescriptionbooleanValueCollector(int index) voidcomputeRow(BytesRefBlock input, int row, Block.Builder[] target, org.apache.lucene.util.BytesRef spare) Executes the evaluation of the corresponding function on the provided input.geoPointValueCollector(int index) intValueCollector(int index, IntPredicate predicate) Creates a collector for primitive int values.longValueCollector(int index) stringValueCollector(int index) toString()
-
Field Details
-
NOOP_STRING_COLLECTOR
-
NOOP_INT_COLLECTOR
-
NOOP_LONG_COLLECTOR
-
NOOP_BOOLEAN_COLLECTOR
public static final CompoundOutputEvaluator.ObjBooleanConsumer<CompoundOutputEvaluator.RowOutput> NOOP_BOOLEAN_COLLECTOR -
NOOP_GEO_POINT_COLLECTOR
-
-
Method Details
-
computeRow
public void computeRow(BytesRefBlock input, int row, Block.Builder[] target, org.apache.lucene.util.BytesRef spare) Executes the evaluation of the corresponding function on the provided input. Thetargetoutput array must have the same size as thefunctionOutputFieldslist that was provided in construction, and its elements must match this list's entries in type and order. Otherwise, this method will throw an exception. If an expected output field is missing from the actual output of the function, a null value will be appended to the corresponding target block. If the actual output of the function contains an entry that is not expected, it will be ignored.- Specified by:
computeRowin interfaceColumnExtractOperator.Evaluator- Parameters:
input- the input to evaluate the function onrow- row index in the inputtarget- the output column blocksspare- theBytesRefto use for value retrieval
-
toString
-
stringValueCollector
-
intValueCollector
public static ObjIntConsumer<CompoundOutputEvaluator.RowOutput> intValueCollector(int index, IntPredicate predicate) Creates a collector for primitive int values.- Parameters:
index- the index of the corresponding block in the target arraypredicate- the predicate to apply on the int value to determine whether to append it or a null- Returns:
- a primitive int collector
-
longValueCollector
-
booleanValueCollector
public static CompoundOutputEvaluator.ObjBooleanConsumer<CompoundOutputEvaluator.RowOutput> booleanValueCollector(int index) -
geoPointValueCollector
-