feat: add implicit dense_vector casting to coalesce#143695
Open
mromaios wants to merge 14 commits intoelastic:mainfrom
Open
feat: add implicit dense_vector casting to coalesce#143695mromaios wants to merge 14 commits intoelastic:mainfrom
mromaios wants to merge 14 commits intoelastic:mainfrom
Conversation
mromaios
commented
Mar 18, 2026
| /** | ||
| * If the first resolved non-NULL child is DENSE_VECTOR, cast remaining keyword/numeric children to dense_vector. | ||
| */ | ||
| private static Expression castChildrenToDenseVector(EsqlScalarFunction f, Configuration configuration) { |
Contributor
Author
There was a problem hiding this comment.
❓ Would we need to validate that if a child is of type dense_vector then all other children need to be null or of a type cast-able to dense_vector?
…b.com:mromaios/elasticsearch into add_dense_vector_implicit_casting_to_coalesce
…b.com:mromaios/elasticsearch into add_dense_vector_implicit_casting_to_coalesce
Collaborator
|
Hi @mromaios, I've created a changelog YAML for you. |
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an attempt to add dense_vector implicit casting in COALESCE
It also adds an interface that makes it easier for
EsqlScalarFunctionto add implicitdense_vectorcasting, while keeping the current VectorFunction for "purely" vector functions.I realise this is mostly a convenience for handwritten examples such as 3d vectors. For the bulk of cases using
to_dense_vectorwhich will be added programmatically it shouldn't be a issue. If it complicates things we can ignore it.Followup from: #142974
Closes #139928