Skip to content

Support date trunc in TS#138947

Merged
dnhatn merged 3 commits intoelastic:mainfrom
dnhatn:time-series-date-trunc
Dec 3, 2025
Merged

Support date trunc in TS#138947
dnhatn merged 3 commits intoelastic:mainfrom
dnhatn:time-series-date-trunc

Conversation

@dnhatn
Copy link
Member

@dnhatn dnhatn commented Dec 2, 2025

With this change, TS will treat date_trunc as equivalent to bucket or tbucket. For example:

TS .. | STATS ... BY ... bucket=DATE_TRUNC(1m, @timestamp)

is equivalent to

TS .. | STATS ... BY ... bucket=TBUCKET(1m)
@dnhatn dnhatn added >bug :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL v9.3.0 v9.2.3 labels Dec 2, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@dnhatn dnhatn requested review from kkrik-es and leontyevdv December 2, 2025 23:11
@dnhatn dnhatn marked this pull request as ready for review December 2, 2025 23:11
@elasticsearchmachine
Copy link
Collaborator

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

@dnhatn dnhatn added auto-backport Automatically create backport pull requests when merged and removed Team:StorageEngine labels Dec 2, 2025
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.

Nice.

@dnhatn
Copy link
Member Author

dnhatn commented Dec 3, 2025

Thanks Kostas!

@dnhatn dnhatn merged commit e6ee2fe into elastic:main Dec 3, 2025
33 of 34 checks passed
@dnhatn dnhatn deleted the time-series-date-trunc branch December 3, 2025 06:13
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

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

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

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 >bug :StorageEngine/ES|QL Timeseries / metrics / PromQL / logsdb capabilities in ES|QL Team:StorageEngine v9.2.3 v9.3.0

3 participants