Skip to content

Fix histogram isNotNullFilter CSV test capabilities#149308

Merged
JonasKunz merged 2 commits into
mainfrom
fix-histo-isnull-tests
May 18, 2026
Merged

Fix histogram isNotNullFilter CSV test capabilities#149308
JonasKunz merged 2 commits into
mainfrom
fix-histo-isnull-tests

Conversation

@JonasKunz
Copy link
Copy Markdown
Contributor

After backporting #148983 to 9.3 and 9.4, the corresponding ES|QL capability became available on those versions too.
This caused the test to attempt to execute in 9.3, which however doesn't have COUNT support on histograms and therefore fails:

org.elasticsearch.client.ResponseException: method [GET], host [http://[::1]:33247], URI [/_query/async/FkxhTnhUZi00VEJTSEtsYkdjRHFTMUEcU3pSSEc0OF9UTEdWa2o0Yzdla1FkQTo4NjIzOQ==?wait_for_completion_timeout=6000s&pretty=true&error_trace=true], status line [HTTP/1.1 400 Bad Request]
¿eerror¿jroot_cause�¿dtypevverification_exceptionfreasonxñverification_exception: Found 1 problem
line 3:15: argument of [COUNT(mostly_empty)] must be [any type except counter types, dense_vector, tdigest, histogram, or exponential_histogram], found value [mostly_empty] type [exponential_histogram]kstack_trace�y��org.elasticsearch.xpack.esql.VerificationException: verification_exception: Found 1 problem
line 3:15: argument of [COUNT(mostly_empty)] must be [any type except counter types, dense_vector, tdigest, histogram, or exponential_histogram], found value [mostly_empty] type [exponential_histogram]
	at org.elasticsearch.xpack.esql.analysis.Analyzer.verify(Analyzer.java:269)
	at org.elasticsearch.xpack.esql…

The fix is to just guard the test in addition on the required capability for COUNT support with histogram types.

@JonasKunz JonasKunz added >test Issues or PRs that are addressing/adding tests test-full-bwc Trigger full BWC version matrix tests :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL labels May 18, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

@JonasKunz please enable the option "Allow edits and access to secrets by maintainers" on your PR. For more information, see the documentation.

@elasticsearchmachine elasticsearchmachine added external-contributor Pull request authored by a developer outside the Elasticsearch team Team:StorageEngine v9.5.0 labels May 18, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@JonasKunz JonasKunz requested a review from kkrik-es May 18, 2026 13:08
@JonasKunz
Copy link
Copy Markdown
Contributor Author

9.0.8 BWC failures in CI should be unrelated, as histograms didn't exist in ES|QL back then. Removing the label and re-running the build to merge.

@JonasKunz JonasKunz removed the test-full-bwc Trigger full BWC version matrix tests label May 18, 2026
@quackaplop quackaplop self-requested a review May 18, 2026 15:44
@JonasKunz JonasKunz merged commit 87024d7 into main May 18, 2026
36 checks passed
@JonasKunz JonasKunz deleted the fix-histo-isnull-tests branch May 18, 2026 15:58
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💔 Backport failed

Status Branch Result
9.4 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 149308

@JonasKunz
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.4

Questions ?

Please refer to the Backport tool documentation

elasticsearchmachine pushed a commit that referenced this pull request May 19, 2026
(cherry picked from commit 87024d7)

# Conflicts:
#	x-pack/plugin/esql/qa/testFixtures/src/main/resources/exponential_histogram.csv-spec
#	x-pack/plugin/esql/qa/testFixtures/src/main/resources/tdigest.csv-spec
benwtrent pushed a commit to benwtrent/elasticsearch that referenced this pull request May 19, 2026
benwtrent added a commit that referenced this pull request May 19, 2026
* Ensure we only serialize IndexModes when they are available

* Fix histogram isNotNullFilter CSV test capabilities (#149308)

* Fix Potential of NPE in PIT search after relocation (#149375)

This PR fixes potential NPEs that can arise from using an updates PIT id after relocation.
The issue is currently guarded by a feature flag an setting and was only observed during testing.

PIT id rewriting in AbstractSearchAsyncAction#maybeReEncodeNodeIds assumes that each
SearchPhaseResult used to update the id has a set ShardSearchContextId. However, there are
certain optimizations under which the data node might return a QuerySearchResult nullInstance()
which doesn't contain a ShardSearchContextId. Using these results to update the PIT id leads
to NPEs when using these ids in subsequent search requests.

The PR fixes this issue by not using the results ShardSearchContextId but the original PIT ids context.
Since only the target nodes change with PIT relocation and the context id remains fixed, this avoids
running into the NPE issues.

Closes #149371

* Revert "Fix Potential of NPE in PIT search after relocation (#149375)"

This reverts commit 54b8a70.

---------

Co-authored-by: Jonas Kunz <jonas.kunz@elastic.co>
Co-authored-by: Christoph Büscher <christophbuescher@posteo.de>
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 backport pending external-contributor Pull request authored by a developer outside the Elasticsearch team :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL Team:StorageEngine >test Issues or PRs that are addressing/adding tests v9.4.2 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants