Skip to content

Conversation

@JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented Aug 22, 2025

Adds a barebones ES|QL and block type for exponential histograms.

To keep this PR as small as possible I've reduced the type to just storing the scale of a histogram and nothing else.
Everything else will be added in follow-up PRs.

Update: To better get the bigger picture, the block has been now fully fleshed out with all sub-blocks in this PR.

In this PR I've marked the shortcuts / disabled tests that definitely need work before we eventually can put this into tech-preview with TODO(b/133393).
Note that I've also excluded the type from some tests (e.g. TopN) without a TODO(b/133393): These are tests which cover functionality which I think won't be needed, at least for a tech-preview. Please carefully review them and let me know if those cover functionality which should work, so that I can add the TODO(b/133393) there aswell.

Initally this PR also included some CSV-tests. But I decided to remove them for now, as they would require implementing a blockloader, increasing the size of the PR unnecessarily. I'll add them back together with the blockloader in a followup PR.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

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

@JonasKunz JonasKunz changed the title PoC: ES|QL block type for exponential histograms ES|QL block type for exponential histograms Sep 5, 2025
@JonasKunz JonasKunz added :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL >feature labels Sep 5, 2025
@JonasKunz JonasKunz marked this pull request as ready for review September 5, 2025 09:54
@JonasKunz JonasKunz requested a review from kkrik-es September 5, 2025 09:54
@elasticsearchmachine
Copy link
Collaborator

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

@kkrik-es kkrik-es requested a review from dnhatn September 5, 2025 11:47
Copy link
Contributor

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

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

I'll leave it to the esql experts to approve.

JonasKunz and others added 2 commits September 5, 2025 14:30
@dnhatn
Copy link
Member

dnhatn commented Oct 22, 2025

What confuses me a little, it that IIUC this is not what's happening right now for AggregateMetricDouble: There we iterate values and copy them manually, instead of reusing the existing readers.

I understand - we should reuse the existing DoublesBlockLoader/IntsBlockLoader to read sub-blocks. Similarly, for the histogram block, there will be at least two blocks: one for zeroThreshold and one for the buckets. The buckets block will be loaded using BytesRefsFromCustomBinary, and zeroThreshold can be loaded with LongsBlockLoader. This approach avoids combining these values during reading. When accessing the histogram value, we can retrieve zeroThreshold and decode the encoded histogram BytesRef from the buckets block.

Is there anything left todo in this PR (except for fixing the merge conflict)?

Just to confirm - you prefer to experiment with our discussion in follow-up PRs. If so, I'll need to take another look to make sure we don’t break existing things.

@JonasKunz JonasKunz force-pushed the exp-histo-esql branch 2 times, most recently from 14d8614 to f491a55 Compare October 23, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :StorageEngine/ES|QL Timeseries / metrics / logsdb capabilities in ES|QL Team:StorageEngine v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants