Class InferenceFunctionEvaluator
java.lang.Object
org.elasticsearch.xpack.esql.inference.InferenceFunctionEvaluator
Evaluator for inference functions that performs constant folding by executing inference operations
at optimization time and replacing them with their computed results.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFactory for creatingInferenceFunctionEvaluatorinstances. -
Method Summary
Modifier and TypeMethodDescriptionfactory()voidfold(InferenceFunction<?> f, ActionListener<Expression> listener) Folds an inference function by executing it and replacing it with its computed result.
-
Method Details
-
factory
-
fold
Folds an inference function by executing it and replacing it with its computed result.This method performs the following steps:
- Validates that the function is foldable (has constant parameters)
- Sets up a minimal execution context with appropriate circuit breakers
- Creates and configures the appropriate inference operator
- Executes the inference operation asynchronously
- Converts the result to a
Literalexpression
- Parameters:
f- the inference function to fold - must be foldable (have constant parameters)listener- the listener to notify when folding completes successfully or fails
-