-
Notifications
You must be signed in to change notification settings - Fork 25.5k
ES|QL - add dense_vector field type and to_dense_vector function to release builds #135604
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
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) |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this now?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these will be released in a separate PR?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.