Skip to content

Commit 1312644

Browse files
committed
[ES|QL] Map Completion logical plan to ConpletionExec physical plan.
1 parent 40c0a2e commit 1312644

File tree

1 file changed

+6
-0
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/mapper

1 file changed

+6
-0
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/mapper/MapperUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.elasticsearch.xpack.esql.plan.logical.RrfScoreEval;
2727
import org.elasticsearch.xpack.esql.plan.logical.TimeSeriesAggregate;
2828
import org.elasticsearch.xpack.esql.plan.logical.UnaryPlan;
29+
import org.elasticsearch.xpack.esql.plan.logical.inference.Completion;
2930
import org.elasticsearch.xpack.esql.plan.logical.inference.Rerank;
3031
import org.elasticsearch.xpack.esql.plan.logical.local.LocalRelation;
3132
import org.elasticsearch.xpack.esql.plan.logical.show.ShowInfo;
@@ -43,6 +44,7 @@
4344
import org.elasticsearch.xpack.esql.plan.physical.RrfScoreEvalExec;
4445
import org.elasticsearch.xpack.esql.plan.physical.ShowExec;
4546
import org.elasticsearch.xpack.esql.plan.physical.TimeSeriesAggregateExec;
47+
import org.elasticsearch.xpack.esql.plan.physical.inference.CompletionExec;
4648
import org.elasticsearch.xpack.esql.plan.physical.inference.RerankExec;
4749
import org.elasticsearch.xpack.esql.planner.AbstractPhysicalOperationProviders;
4850

@@ -99,6 +101,10 @@ static PhysicalPlan mapUnary(UnaryPlan p, PhysicalPlan child) {
99101
);
100102
}
101103

104+
if (p instanceof Completion completion) {
105+
return new CompletionExec(completion.source(), child, completion.inferenceId(), completion.prompt(), completion.targetField());
106+
}
107+
102108
if (p instanceof Enrich enrich) {
103109
return new EnrichExec(
104110
enrich.source(),

0 commit comments

Comments
 (0)