elasticsearch
elasticsearch copied to clipboard
semantic_text as string type in ES|QL - support for functions and operators
tracked in https://github.com/elastic/elasticsearch/issues/115103
Related: https://github.com/elastic/elasticsearch/pull/114334 that disallows functions to return TEXT type values. We need to pay attention to this one, it will likely be merged first.
Description
This adds support for semantic_text as a string type in ES|QL and checks the support for functions and operators (https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-functions-operators.html).
The process was:
- make
semantic_texta string type: https://github.com/elastic/elasticsearch/blob/167e55bc63e559fa6f5e05584a2d215a50034955/x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/type/DataType.java#L372-L377 - run the tests and fix any failures
- for each function/operator that supports keyword/text (docs)write CSV tests to use them with
semantic_text; fix any failures - for each function/operator that support
semantic_textensure we have test coverage when the arguments are of typesemantic_text
Next
This PR takes care of only functions/operator support. Things that are not covered by tests here, but will be in a follow up:
- the STATS command:
- support for all commands (from docs) e.g.:
- STATS
- DISSECT
- ENRICH
- GROK
- LOOKUP
- INLINESTATS
If preferred I can make the rest of the changes here to ensure the support for commands too, but I figured it might be easier to review this in 2 parts.
@elasticmachine update branch
Pinging @elastic/es-analytical-engine (Team:Analytics)
@craigtaverner do you have time to take a look at this one?
@elasticmachine update branch
💔 Backport failed
The backport operation could not be completed due to the following error:
An unexpected error occurred when attempting to backport this PR.
You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 115243