Skip to content

Commit ac93799

Browse files
committed
Rework inference resolution error.
1 parent a969131 commit ac93799

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/inference/InferencePlan.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.common.io.stream.StreamOutput;
1111
import org.elasticsearch.inference.TaskType;
1212
import org.elasticsearch.xpack.esql.core.expression.Expression;
13+
import org.elasticsearch.xpack.esql.core.expression.UnresolvedAttribute;
1314
import org.elasticsearch.xpack.esql.core.tree.Source;
1415
import org.elasticsearch.xpack.esql.plan.logical.LogicalPlan;
1516
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
@@ -58,5 +59,9 @@ public int hashCode() {
5859

5960
public abstract TaskType taskType();
6061

61-
public abstract LogicalPlan withInferenceResolutionError(String inferenceId, String error);
62+
public abstract InferencePlan withInferenceId(Expression newInferenceId);
63+
64+
public InferencePlan withInferenceResolutionError(String inferenceId, String error) {
65+
return withInferenceId(new UnresolvedAttribute(inferenceId().source(), inferenceId, error));
66+
}
6267
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/inference/Rerank.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ public TaskType taskType() {
103103
}
104104

105105
@Override
106-
public Rerank withInferenceResolutionError(String inferenceId, String error) {
107-
Expression newInferenceId = new UnresolvedAttribute(inferenceId().source(), inferenceId, error);
106+
public Rerank withInferenceId(Expression newInferenceId) {
108107
return new Rerank(source(), child(), newInferenceId, queryText, rerankFields, scoreAttribute);
109108
}
110109

0 commit comments

Comments
 (0)