Skip to content

ES|QL - fix dense vector enrich bug#139774

Merged
carlosdelest merged 14 commits intoelastic:mainfrom
carlosdelest:bugfix/esql-dense-vector-enrich-bugfix
Jan 12, 2026
Merged

ES|QL - fix dense vector enrich bug#139774
carlosdelest merged 14 commits intoelastic:mainfrom
carlosdelest:bugfix/esql-dense-vector-enrich-bugfix

Conversation

@carlosdelest
Copy link
Member

Closes #137699

ENRICH in ES|QL didn't work when using dense_vector as a column for adding as part of the ENRICH command.

This PR addresses it by:

  • Creating an EnrichResultBuilderForFloat that takes care of dense_vector blocks, which are FLOAT internally
  • Adding or changing tests so we ensure dense_vector fields can be added as part of the ENRICH

@carlosdelest carlosdelest added >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) auto-backport Automatically create backport pull requests when merged :Search Relevance/ES|QL Search functionality in ES|QL v9.3.0 v9.4.0 labels Dec 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @carlosdelest, I've created a changelog YAML for you.

@carlosdelest carlosdelest marked this pull request as ready for review December 19, 2025 10:36
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Dec 19, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@elasticsearchmachine elasticsearchmachine removed the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 19, 2025
Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Not a full review, but can we also add dense_vector to the enrich-related tests in AllSupportedFieldsTestCase? This guards against regressions in FROM | ENRICH and ROW | ENRICH queries where the enrich fields are of all kinds of types. Currently, we exclude dense vector fields

…tor-enrich-bugfix

# Conflicts:
#	x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/AllSupportedFieldsTestCase.java
@carlosdelest carlosdelest requested review from a team and alex-spies December 22, 2025 11:11
Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Thanks @carlosdelest !

I'm afraid you'll need to add test-release and run AllSupportedFieldsIT in release mode. I expect failures, esp. in testRowEnrich, because the tests run all kinds of bwc setups, and supportedInEnrich currently doesn't take the versions into account. This method controls the test expectations as well as the setup, and while it was previously generally true that we wouldn't expect dense vector fields in the enrich policy, now we do but only if the cluster already has the bugfix. To decide the right test expectation, we'll probably have to take the presence of the ENRICH_DENSE_VECTOR_BUGFIX capability into account in these tests.

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Apart from my comments on AllSupportedFieldsTestCase, the change looks right to me. Thanks, Carlos!

@carlosdelest carlosdelest added the test-release Trigger CI checks against release build label Dec 23, 2025
@carlosdelest
Copy link
Member Author

@elasticmachine test this please

@carlosdelest
Copy link
Member Author

I'm afraid you'll need to add test-release and run AllSupportedFieldsIT in release mode. I expect failures, esp. in testRowEnrich, because the tests run all kinds of bwc setups, and supportedInEnrich currently doesn't take the versions into account.

@alex-spies I set the test-release label and I don't see any related failures for those tests. I think we should be good to go?

…tor-enrich-bugfix

# Conflicts:
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
…nrich-bugfix' into bugfix/esql-dense-vector-enrich-bugfix
@carlosdelest
Copy link
Member Author

@alex-spies I set the test-release label and I don't see any related failures for those tests. I think we should be good to go?

@alex-spies after-Christmas bump 🎄 😉

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

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

Nice, thanks for adding dense_vector to the all supported fields tests, @carlosdelest !

@carlosdelest carlosdelest removed the test-release Trigger CI checks against release build label Jan 12, 2026
@carlosdelest carlosdelest enabled auto-merge (squash) January 12, 2026 09:09
@carlosdelest
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/part-2

@carlosdelest carlosdelest merged commit 4f5e15c into elastic:main Jan 12, 2026
35 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.3

carlosdelest added a commit to carlosdelest/elasticsearch that referenced this pull request Jan 12, 2026
szybia added a commit to szybia/elasticsearch that referenced this pull request Jan 12, 2026
…i-project-tests

* upstream/main: (23 commits)
  Fix `testAckListenerReceivesNacksIfPublicationTimesOut` (elastic#140514)
  Reduce priority of clear-cache tasks (elastic#139685)
  Add docs and tests about `StreamOutput` to memory (elastic#140365)
  ES|QL - dense_vector support for COUNT, PRESENT, ABSENT aggregator functions (elastic#139914)
  Add release notes for v9.2.4 release (elastic#140487)
  Add release notes for v9.1.10 release (elastic#140488)
  Add conncectors release notes for 9.1.10, 9.2.4 (elastic#140499)
  Add parameter support in PromQL query durations (elastic#139873)
  Improve testing of STS credentials reloading (elastic#140114)
  Fix zstd native binary publishing script to support newer versions (elastic#140485)
  Add FlattenedFieldBinaryVsSortedSetDocValuesSyntheticSourceIT (elastic#140489)
  Store fallback match only text fields in binary doc values (elastic#140189)
  [DiskBBQ] Use the new merge executor for intra-merge parallelism (elastic#139942)
  ESQL: introduce support for mapping-unavailable fields (elastic#140463)
  Add ESNextOSQVectorsScorerTests (elastic#140436)
  Disable high cardinality tests on release builds (elastic#140503)
  ESQL: TRange timezone support (elastic#139911)
  Directly compressing `StreamOutput` (elastic#140502)
  ES|QL - fix dense vector enrich bug (elastic#139774)
  Use CrossProjectModeDecider in RemoteClusterService (elastic#140481)
  ...
spinscale pushed a commit to spinscale/elasticsearch that referenced this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Search Relevance/ES|QL Search functionality in ES|QL Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.3.0 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESQL: Cannot use dense_vector in ENRICH

3 participants