Skip to content

Make TDigest ESQL type available outside of snapshot builds#139588

Closed
JonasKunz wants to merge 6 commits intoelastic:mainfrom
JonasKunz:tdigest-remove-feature-flag
Closed

Make TDigest ESQL type available outside of snapshot builds#139588
JonasKunz wants to merge 6 commits intoelastic:mainfrom
JonasKunz:tdigest-remove-feature-flag

Conversation

@JonasKunz
Copy link
Copy Markdown
Contributor

@JonasKunz JonasKunz commented Dec 16, 2025

This PR makes the T-Digest ESQL type available outside of snapshot builds.
Note that the feature flag still remains, but now only corresponds to whether the tdigest ES field mapper is enabled or not, the ES|QL type is enabled unconditionally (it is not underConstruction anymore).

Unfortunately this means that we can't run the existing CSV-tests outside of snapshots, as they require the ES field type.
We should soon-ish add CSV tests which load histogram fields, convert them to tdigest and then run the corresponding queries. Those can then be run outside of snapshot builds.

@elasticsearchmachine elasticsearchmachine added external-contributor Pull request authored by a developer outside the Elasticsearch team v9.3.0 labels Dec 16, 2025
@JonasKunz JonasKunz added the test-release Trigger CI checks against release build label Dec 16, 2025
@JonasKunz JonasKunz requested a review from kkrik-es December 16, 2025 11:30
@JonasKunz JonasKunz marked this pull request as ready for review December 16, 2025 11:31
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 16, 2025
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@github-actions
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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.

Heya, do we want to add TDIGEST to the AllSupportedFieldsTestCase?

@JonasKunz
Copy link
Copy Markdown
Contributor Author

Heya, do we want to add TDIGEST to the AllSupportedFieldsTestCase?

Yes, definitely. For that to happen however we need to have lifted the feature flag for the ES field mapper for the tdigest IIUC?

This PR only adds the ES|QL type outside of snapshots, not the ES field type.
After it is merged, the only way to make use of T-Digest field type is via type conversions e.g. from histogram. So I think we can't add it to AllSupportedFieldsTestCase yet?

@alex-spies
Copy link
Copy Markdown
Contributor

After it is merged, the only way to make use of T-Digest field type is via type conversions e.g. from histogram. So I think we can't add it to AllSupportedFieldsTestCase yet?

Ah, I wondered if this is the case. In this case, this is not an indexable type and it's correct to exclude it from AllSupportedFieldsTestCase. That test is to make sure that new data types don't blow up FROM * | KEEP *-style queries; not queries that specifically require a ::tdigest or so - those are fine to test with regular spec tests, which run in bwc scenarios automatically.

* @see DataType#isRepresentable(DataType)
*/
public static TypeResolution isRepresentableExceptCountersDenseVectorAggregateMetricDoubleAndExponentialHistogram(
public static TypeResolution isRepresentableExceptCountersDenseVectorAggregateMetricDoubleAndHistogram(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please don't do this. Just inline this function, this is much harder to read.

@JonasKunz
Copy link
Copy Markdown
Contributor Author

Closed in favor of #139607

@JonasKunz JonasKunz closed this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) test-release Trigger CI checks against release build v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants