Skip to content

[8.x] [ESQL] Add support for date trunc on date nanos type #116354 #116422

Merged
elasticsearchmachine merged 1 commit intoelastic:8.xfrom
not-napoleon:backport-116354-to-8.x
Nov 7, 2024
Merged

[8.x] [ESQL] Add support for date trunc on date nanos type #116354 #116422
elasticsearchmachine merged 1 commit intoelastic:8.xfrom
not-napoleon:backport-116354-to-8.x

Conversation

@not-napoleon
Copy link
Copy Markdown
Member

Resolves #110008

As discussed elsewhere, this does NOT allow for truncating to a value smaller than a millisecond. Our timespan literal syntax doesn't allow specifying less than a millisecond, and the rounding infrastructure also does not support it.

We also had a discussion regarding the return type, and decided that it made sense to keep the type as date_nanos, even though the truncation will always produce a millisecond-rounded (or higher) value.

Resolves elastic#110008

As discussed elsewhere, this does NOT allow for truncating to a value smaller than a millisecond. Our timespan literal syntax doesn't allow specifying less than a millisecond, and the rounding infrastructure also does not support it.

We also had a discussion regarding the return type, and decided that it made sense to keep the type as date_nanos, even though the truncation will always produce a millisecond-rounded (or higher) value.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@not-napoleon not-napoleon added >non-issue backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Analytics/ES|QL AKA ESQL v8.17.0 labels Nov 7, 2024
@elasticsearchmachine elasticsearchmachine merged commit 56cf0f3 into elastic:8.x Nov 7, 2024
@not-napoleon not-napoleon deleted the backport-116354-to-8.x branch November 7, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >non-issue v8.17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants