Skip to content

Support date trunc in TS - #138947

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

dnhatn merged 3 commits into
elastic:mainfrom
dnhatn:time-series-date-trunc

Conversation

@dnhatn

@dnhatn dnhatn commented Dec 2, 2025 •

Copy link
Copy Markdown
Member

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 / logsdb capabilities in ES|QL v9.3.0 v9.2.3 labels Dec 2, 2025
@elasticsearchmachine

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

@kkrik-es kkrik-es left a comment

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.

Nice.

@dnhatn

dnhatn commented Dec 3, 2025

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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 >bug :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.

3 participants