2222import org .elasticsearch .xpack .esql .core .expression .NamedExpression ;
2323import org .elasticsearch .xpack .esql .core .expression .UnresolvedAttribute ;
2424import org .elasticsearch .xpack .esql .core .expression .predicate .operator .comparison .BinaryComparison ;
25- import org .elasticsearch .xpack .esql .core .type .DataType ;
2625import org .elasticsearch .xpack .esql .expression .Order ;
2726import org .elasticsearch .xpack .esql .expression .UnresolvedNamePattern ;
2827import org .elasticsearch .xpack .esql .expression .function .UnresolvedFunction ;
@@ -3423,7 +3422,7 @@ public void testCompletionUsingFieldAsPrompt() {
34233422
34243423 assertThat (plan .prompt (), equalTo (attribute ("prompt_field" )));
34253424 assertThat (plan .inferenceId (), equalTo (literalString ("inferenceID" )));
3426- assertThat (plan .targetField (), equalTo (referenceAttribute ("targetField" , DataType . TEXT )));
3425+ assertThat (plan .targetField (), equalTo (attribute ("targetField" )));
34273426 }
34283427
34293428 public void testCompletionUsingFunctionAsPrompt () {
@@ -3433,7 +3432,7 @@ public void testCompletionUsingFunctionAsPrompt() {
34333432
34343433 assertThat (plan .prompt (), equalTo (function ("CONCAT" , List .of (attribute ("fieldA" ), attribute ("fieldB" )))));
34353434 assertThat (plan .inferenceId (), equalTo (literalString ("inferenceID" )));
3436- assertThat (plan .targetField (), equalTo (referenceAttribute ("targetField" , DataType . TEXT )));
3435+ assertThat (plan .targetField (), equalTo (attribute ("targetField" )));
34373436 }
34383437
34393438 public void testCompletionDefaultFieldName () {
@@ -3443,7 +3442,7 @@ public void testCompletionDefaultFieldName() {
34433442
34443443 assertThat (plan .prompt (), equalTo (attribute ("prompt_field" )));
34453444 assertThat (plan .inferenceId (), equalTo (literalString ("inferenceID" )));
3446- assertThat (plan .targetField (), equalTo (referenceAttribute ("completion" , DataType . TEXT )));
3445+ assertThat (plan .targetField (), equalTo (attribute ("completion" )));
34473446 }
34483447
34493448 public void testCompletionWithPositionalParameters () {
@@ -3454,7 +3453,7 @@ public void testCompletionWithPositionalParameters() {
34543453
34553454 assertThat (plan .prompt (), equalTo (attribute ("prompt_field" )));
34563455 assertThat (plan .inferenceId (), equalTo (literalString ("inferenceId" )));
3457- assertThat (plan .targetField (), equalTo (referenceAttribute ("completion" , DataType . TEXT )));
3456+ assertThat (plan .targetField (), equalTo (attribute ("completion" )));
34583457 }
34593458
34603459 public void testCompletionWithNamedParameters () {
@@ -3465,7 +3464,7 @@ public void testCompletionWithNamedParameters() {
34653464
34663465 assertThat (plan .prompt (), equalTo (attribute ("prompt_field" )));
34673466 assertThat (plan .inferenceId (), equalTo (literalString ("myInference" )));
3468- assertThat (plan .targetField (), equalTo (referenceAttribute ("completion" , DataType . TEXT )));
3467+ assertThat (plan .targetField (), equalTo (attribute ("completion" )));
34693468 }
34703469
34713470 public void testInvalidCompletion () {
0 commit comments