Skip to content

ESQL - Add dense_vector SUM function#142129

Merged
carlosdelest merged 59 commits intoelastic:mainfrom
carlosdelest:feature/esql-dense-vector-avg-function
Mar 5, 2026
Merged

ESQL - Add dense_vector SUM function#142129
carlosdelest merged 59 commits intoelastic:mainfrom
carlosdelest:feature/esql-dense-vector-avg-function

Conversation

@carlosdelest
Copy link
Copy Markdown
Member

@carlosdelest carlosdelest commented Feb 9, 2026

Adds dense_vector support for SUM.

This is a first step for getting AVG dense_vector support (as we can implement it as a surrogate using SUM / COUNT) and a validation that aggregation functions are implemented the right way for dense_vectors with this approach.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

ℹ️ 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 overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

elasticsearchmachine and others added 24 commits February 9, 2026 12:29
…avg-function' into feature/esql-dense-vector-avg-function
…avg-function' into feature/esql-dense-vector-avg-function
…avg-function' into feature/esql-dense-vector-avg-function
…ctor-avg-function

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/SumTests.java
…avg-function' into feature/esql-dense-vector-avg-function
…avg-function' into feature/esql-dense-vector-avg-function
@carlosdelest carlosdelest added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 11, 2026
}

@Override
public void toIntermediate(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can potentially use toValuesBlock() or extract out duplicate code.

Copy link
Copy Markdown
Member Author

@carlosdelest carlosdelest Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, done in c5d02e0

…ctor-avg-function

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
Copy link
Copy Markdown
Contributor

@ivancea ivancea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, LGTM! Let's add warnings in a different issue, as it may require some extra iteration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix.
This class generates classes. As this code path was never executed in main, this never failed. I took it from #141272

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same; fix from the other PR

}
}

public void failed(boolean failed) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now called from the autogenerated Function class!
For the grouping function, it's within the AbstractFallibleArrayState, so it's automatically handled by the generated code

@carlosdelest carlosdelest merged commit 8f02053 into elastic:main Mar 5, 2026
35 checks passed
@carlosdelest
Copy link
Copy Markdown
Member Author

Thank you for all your help on this one @ivancea !

jfreden pushed a commit to jfreden/elasticsearch that referenced this pull request Mar 5, 2026
spinscale pushed a commit to spinscale/elasticsearch that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/ES|QL Search functionality in ES|QL Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants