ES|QL - add dense_vector field type and to_dense_vector function to release builds#135604
Conversation
ℹ️ 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?
|
…tech-preview' into feature/esql-dense-vector-tech-preview
…ctor-tech-preview
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
|
Pinging @elastic/kibana-esql (ES|QL-ui) |
alex-spies
left a comment
There was a problem hiding this comment.
Looks good - I have some minor, non-blocking comments.
I hate to say it, but we probably need to apply the test-release and test-full-bwc labels and see what additional test failures we may now get.
|
|
||
| public static final FeatureFlag AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG = new FeatureFlag("esql_aggregate_metric_double"); | ||
| public static final FeatureFlag DENSE_VECTOR_FEATURE_FLAG = new FeatureFlag("esql_dense_vector"); |
There was a problem hiding this comment.
++
I don't think we will use feature flags for under construction types going forward. We don't ask remote nodes if they have the same feature flag enabled, and don't have a good mechanism (yet) for when they don't.
| } | ||
|
|
||
| @ConvertEvaluator(extraName = "FromFloat") | ||
| static BytesRef fromFloat(float flt) { |
There was a problem hiding this comment.
Why do we need this now?
There was a problem hiding this comment.
Dense vectors are internally represented as Float blocks - I don't think we had a valid ToString on floats as they are not representable AFAIU
There was a problem hiding this comment.
Ah, okay. The javadoc on the type says it's arrays of doubles, which got me confused. Thanks!
| def(Knn.class, tri(Knn::new), "knn"), | ||
| def(CosineSimilarity.class, CosineSimilarity::new, "v_cosine"), | ||
| def(DotProduct.class, DotProduct::new, "v_dot_product"), | ||
| def(L1Norm.class, L1Norm::new, "v_l1_norm"), | ||
| def(L2Norm.class, L2Norm::new, "v_l2_norm"), |
There was a problem hiding this comment.
I guess these will be released in a separate PR?
There was a problem hiding this comment.
yes, we want to improve performance before releasing vector similarity functions
| entries.add(ToDatetime.ENTRY); | ||
| entries.add(ToDateNanos.ENTRY); | ||
| entries.add(ToDegrees.ENTRY); | ||
| if (EsqlCapabilities.Cap.TO_DENSE_VECTOR_FUNCTION.isEnabled()) { |
There was a problem hiding this comment.
Nice that you're cleaning this up, too. Not technically necessary, but nice.
...in/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/TypeResolutions.java
Outdated
Show resolved
Hide resolved
...in/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/TypeResolutions.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AbsentErrorTests.java
Show resolved
Hide resolved
...va/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCountErrorTests.java
Show resolved
Hide resolved
…tech-preview' into feature/esql-dense-vector-tech-preview
|
Hi @carlosdelest, I've updated the changelog YAML for you. |
…ctor-tech-preview # Conflicts: # server/src/main/resources/transport/upper_bounds/9.2.csv
…tech-preview' into feature/esql-dense-vector-tech-preview
…tech-preview' into feature/esql-dense-vector-tech-preview
Take dense_vector field type an TO_DENSE_VECTOR function out of snapshot builds.
This means that support must be explicitly removed for some functions and operators:
It is alsosupported by the following functions:
Feature flag is removed, and capability checks removed where applicable.
Docs have been updated for the above functions, vector similarity functions, and knn.