Skip to content

ESQL: TSTEP #1#143507

Merged
sidosera merged 4 commits intoelastic:mainfrom
sidosera:feature/esql-tstep
Mar 24, 2026
Merged

ESQL: TSTEP #1#143507
sidosera merged 4 commits intoelastic:mainfrom
sidosera:feature/esql-tstep

Conversation

@sidosera
Copy link
Copy Markdown
Contributor

@sidosera sidosera commented Mar 3, 2026

Small refactoring to handle time patterns needed for TBUCKET/TSTEP bucketing.

Issue: #139187

Stack:

@sidosera sidosera added Team:StorageEngine :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL labels Mar 4, 2026
@sidosera sidosera force-pushed the feature/esql-tstep branch from 1c5f1d6 to 13aac4c Compare March 4, 2026 21:43
@sidosera sidosera linked an issue Mar 10, 2026 that may be closed by this pull request
@sidosera sidosera force-pushed the feature/esql-tstep branch from e150e13 to 156e275 Compare March 12, 2026 12:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

🔍 Preview links for changed docs

@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?

@sidosera sidosera requested review from a team, dnhatn, felixbarny, kkrik-es and leontyevdv March 12, 2026 17:23
@sidosera
Copy link
Copy Markdown
Contributor Author

@leontyevdv for thoughts on how to integrate this with your window function change.

@sidosera sidosera force-pushed the feature/esql-tstep branch from 40e0041 to deb633e Compare March 17, 2026 18:10
@sidosera sidosera marked this pull request as ready for review March 17, 2026 18:15
@sidosera sidosera requested review from a team as code owners March 17, 2026 18:15
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@felixbarny
Copy link
Copy Markdown
Member

This is a very large PR. Could you split it up into smaller chunks?

When this is in, we should be able to support PromQL instant queries where start=end, right?

TSTEP should also support specifying the number of target buckets similar to TBUCKET, see #144057 and #142747. These can be separate changes.

@sidosera
Copy link
Copy Markdown
Contributor Author

@elasticmachine test this please

@sidosera sidosera mentioned this pull request Mar 22, 2026
@sidosera sidosera removed request for a team March 22, 2026 17:38
@sidosera sidosera changed the title ESQL: TSTEP ESQL: TSTEP #1 Mar 22, 2026
@sidosera
Copy link
Copy Markdown
Contributor Author

@elasticmachine test this please

@sidosera
Copy link
Copy Markdown
Contributor Author

@felixbarny

This is a large PR. Could you split it into smaller chunks?

Yeah, fair point. GitHub still makes stacked changes pretty awkward to manage, imo, so I usually avoid splitting things too much unless the diff starts getting hard to review. But this one is probably at that point, so I split it up a bit to make it easier to digest.

When this lands, we should be able to support PromQL instant queries where start = end, right?

Most likely, yes. But I didn't check that explicitly. We already use inclusive bounds, so start == end should match that exact timestamp I guess.

TSTEP should also support specifying the number of target buckets, similar to TBUCKET; see #144057 and #142747. These can be separate changes.

Agreed. We'll follow up on that separately.

@sidosera sidosera force-pushed the feature/esql-tstep branch from 379805c to ba2e060 Compare March 22, 2026 19:19
@felixbarny
Copy link
Copy Markdown
Member

felixbarny commented Mar 23, 2026

Yeah, fair point. GitHub still makes stacked changes pretty awkward to manage, imo

I agree it's less than ideal. We should still avoid creating PRs with > 500 lines changed. Some recent learnings I had to make it a bit more bearable:

  • If possible, avoid stacking by creating PRs that touch distinct set of files.
  • When you do need to stack
    • Push the branches to origin/upstream, not your fork. That way you can actually stack your branches. For example pr-1 can target main and pr-2 can target pr-1. That way, when looking at pr-2, it doesn't show the commits of pr-1. When pr-1 gets merged, you can change the target from pr-2 to main.
    • Add a dependency graph of the stacked PRs as a simple nested markdown list. All PRs at the top-level are independent, stacked PRs add another nesting level.
    • Create the PRs around themes and give them a descriptive name (rather than #1, #2, #3)

@sidosera sidosera force-pushed the feature/esql-tstep branch from ba2e060 to 6590a18 Compare March 23, 2026 12:10
@sidosera sidosera requested a review from kkrik-es March 23, 2026 12:53
@sidosera sidosera force-pushed the feature/esql-tstep branch from 6590a18 to 2e1b850 Compare March 23, 2026 13:10
@sidosera
Copy link
Copy Markdown
Contributor Author

@elasticmachine test this please

dnhatn

This comment was marked as off-topic.

Copy link
Copy Markdown
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

One comment, but looks good. And sorry for the noise, Claude posted its review without asking.

* to resolve date math expressions consistently with the current request.
*/
@Nullable
public static TimestampBounds extractTimestampBounds(@Nullable QueryBuilder filter, LongSupplier nowSupplier) {
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.

Can we remove the extractTimestampBounds without nowSupplier

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. Will follow-up in the next PRs.

@sidosera sidosera enabled auto-merge (squash) March 24, 2026 13:02
@sidosera sidosera disabled auto-merge March 24, 2026 15:04
@sidosera sidosera merged commit af22a82 into elastic:main Mar 24, 2026
33 of 35 checks passed
@sidosera sidosera deleted the feature/esql-tstep branch March 24, 2026 15:04
@sidosera
Copy link
Copy Markdown
Contributor Author

Test fails with multi-value errors in LIKE/RLIKE operators. This is unrelated to TSTEP.

This was referenced Mar 25, 2026
@sidosera sidosera mentioned this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add STEP to offset buckets from current time

5 participants