-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL - TO_DENSE_VECTOR function and additional casting #134003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESQL - TO_DENSE_VECTOR function and additional casting #134003
Conversation
…literal translation is done
…r-casting' into non-issue/esql-dense-vector-casting # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToDenseVector.java
🔍 Preview links for changed docs |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
…e for checking which args to convert
…vector-casting # Conflicts: # x-pack/plugin/esql/qa/testFixtures/src/main/resources/knn-function.csv-spec # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work Carlos, LGTM!
| Source source, | ||
| @Param( | ||
| name = "field", | ||
| type = { "double", "long", "integer", "keyword" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add text as well (if it is loaded from an ES text field)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say no - it's ok to allow for hex string constants, but I don't think they should be analyzed in any way or retrieved from an analyzed field.
If any time this is needed, they can be converted via the ::keyword casting operator.
…r-casting' into non-issue/esql-dense-vector-casting
…r-casting' into non-issue/esql-dense-vector-casting
…vector-casting # Conflicts: # x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java
Adds a TO_DENSE_VECTOR conversion function to convert to dense_vectors:
Also, performs automatic conversion of vector values for
VectorFunctioninstances on theAnalyzer:or
The Analyzer will convert automatically keyword fields via
castStringLiteral, and add aTO_DENSE_VECTORfunction for numeric values.In order to use a reference attribute for a vector function, we need to use TO_DENSE_VECTOR explicitly, just like other types like IP:
For now, hex strings gets translated to byte dense_vectors. We can create a follow up function TO_BIT_DENSE_VECTOR for using hex strings for bit vectors, or add an optional parameter to TO_DENSE_VECTOR.