Skip to content

[ESQL] Add support for date trunc on date nanos type#116354

Merged
not-napoleon merged 14 commits intoelastic:mainfrom
not-napoleon:esql-date-trunc-support-date-nanos
Nov 7, 2024
Merged

[ESQL] Add support for date trunc on date nanos type#116354
not-napoleon merged 14 commits intoelastic:mainfrom
not-napoleon:esql-date-trunc-support-date-nanos

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.

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Nov 6, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@nik9000
Copy link
Copy Markdown
Member

nik9000 commented Nov 6, 2024

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.

Meaning the truncating a date_nanos will still produce a date_nanos. Right now. And, well, for a long time, we don't have any tools that let you truncate to some number of nanoseconds or microseconds.

@not-napoleon
Copy link
Copy Markdown
Member Author

@elasticmachine update branch

@not-napoleon not-napoleon merged commit 138bfec into elastic:main Nov 7, 2024
not-napoleon added a commit to not-napoleon/elasticsearch that referenced this pull request Nov 7, 2024
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
Copy link
Copy Markdown
Member Author

I forgot to put the auto-backport tag on this, so the manual backport is here: #116422

elasticsearchmachine pushed a commit that referenced this pull request Nov 7, 2024
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.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kderusso pushed a commit to kderusso/elasticsearch that referenced this pull request Nov 7, 2024
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>
jozala pushed a commit that referenced this pull request Nov 13, 2024
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.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ESQL] Date Trunc function should support date nanos

4 participants