Skip to content

Commit c30c0ec

Browse files
committed
Restore previous implementation of foldable for TextEmbedding function.
1 parent a032cc2 commit c30c0ec

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/inference/InferenceFunction.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,4 @@ protected InferenceFunction(Source source, List<Expression> children) {
3636
public abstract TaskType taskType();
3737

3838
public abstract PlanType withInferenceResolutionError(String inferenceId, String error);
39-
40-
@Override
41-
public boolean foldable() {
42-
// Inference functions are not foldable and need to be evaluated using an async inference call.
43-
return false;
44-
}
4539
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/inference/TextEmbedding.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public Expression inferenceId() {
9191
return inferenceId;
9292
}
9393

94+
@Override
95+
public boolean foldable() {
96+
return inferenceId.foldable() && inputText.foldable();
97+
}
98+
9499
@Override
95100
public DataType dataType() {
96101
return DataType.DENSE_VECTOR;

0 commit comments

Comments
 (0)