Sister issue to #141870. They are probably related, to the point where fixing one of them might also fix the other.
I ran the single node spec tests while prepending SET unmapped_fields="load" to the query each time unless there was already a SET directive, by adding the following to EsqlSpecTestCase#doTest:
if (query.startsWith("SET") == false) {
query = "SET unmapped_fields=\"load\"; " + query;
}
./gradlew ":x-pack:plugin:esql:qa:server:single-node:javaRestTest" --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT" -Dtests.method="test {csv-spec:lookup-join.MultipleBatchesWithAggregate3}"
reason: "Found 2 problems\nline 5:33: Cannot use field [birth_date] due to ambiguities\
\ being mapped as [2] incompatible types: [keyword] enforced by INSIST command,\
\ and [datetime] in index mappings\nline 5:15: Cannot use field [language_code]\
\ due to ambiguities being mapped as [2] incompatible types: [keyword] enforced\
\ by INSIST command, and [integer] in index mappings"
There's several of these.
./gradlew ":x-pack:plugin:esql:qa:server:single-node:javaRestTest" --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT" -Dtests.method="test {csv-spec:dissect.AvoidAttributesRemoval2}"
- type: "verification_exception"
reason: "Found 1 problem\nline 2:8: EVAL does not support type [unsupported] as\
\ the return data type of expression [client_ip]"
This one only happened once.
./gradlew ":x-pack:plugin:esql:qa:server:single-node:javaRestTest" --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT" -Dtests.method="test {csv-spec:vector-l2-norm.SimilarityWithSubqueries}"
- type: "illegal_state_exception"
reason: "Found 1 problem\nline 2:3: Plan [Eval[[L2NORM(rgb_vector{r}#23803,[0.0,\
\ 255.0, 255.0][DENSE_VECTOR]) AS similarity#23789]]] optimized incorrectly\
\ due to missing references [rgb_vector{r}#23803]"
Also several of these; not just in subqueries. This is peculiar, as I can see union type resolution in queries that don't have union types update, id is indeed a union type in this test :
./gradlew ":x-pack:plugin:esql:qa:server:single-node:javaRestTest" --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT" -Dtests.method="test {csv-spec:lookup-join.JoinOnMultiTypedMatchFieldCastToInteger}"
- type: "illegal_state_exception"
reason: "Found 1 problem\nline 5:3: Plan [Join[LEFT,[$$id$converted_to$integer{f$}#23827],[language_code{f}#23825],null]]\
\ optimized incorrectly due to missing references from right hand side [language_code{f}#23825]"
./gradlew ":x-pack:plugin:esql:qa:server:single-node:javaRestTest" --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecIT" -Dtests.method="test {csv-spec:vector-dot-product.SimilarityWithFork}"
- type: "illegal_state_exception"
reason: "Found 1 problem\nline 3:3: Plan [Eval[[DOTPRODUCT(rgb_vector{r}#33878,[0.0,\
\ 255.0, 255.0][DENSE_VECTOR]) AS similarity#33864]]] optimized incorrectly\
\ due to missing references [rgb_vector{r}#33878]"
Sister issue to #141870. They are probably related, to the point where fixing one of them might also fix the other.
I ran the single node spec tests while prepending SET unmapped_fields="load" to the query each time unless there was already a SET directive, by adding the following to EsqlSpecTestCase#doTest:
There's several of these.
This one only happened once.
Also several of these; not just in subqueries. This is peculiar, as I can see
union type resolution in queries that don't have union typesupdate,idis indeed a union type in this test :