Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: support date_nanos data type #38562

Closed
costin opened this issue Feb 7, 2019 · 2 comments · Fixed by #67666
Closed

SQL: support date_nanos data type #38562

costin opened this issue Feb 7, 2019 · 2 comments · Fixed by #67666
Assignees
Labels
:Analytics/SQL SQL querying >enhancement Team:QL (Deprecated) Meta label for query languages team

Comments

@costin
Copy link
Member

costin commented Feb 7, 2019

Dates with nanoseconds precision are now supported in ES and a new data type has been introduced (date_nanos).
SQL needs to support this type - likely, not by adding a different type (at least for the user) but by extending the precision of a particular date.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@matriv
Copy link
Contributor

matriv commented Apr 1, 2019

Once this is introduced the CURRENT_TIMESTAMP(x)/CURRENT_TIME(x) x > 3 should be also fixed and this comment should be removed: https://github.com/elastic/elasticsearch/pull/40669/files#diff-b91ca24147aa7c0d4371fa129d3e51bdR190

Also, currently the now stored in the Configuration is set with ZonedDateTime.now(zoneId) so the precision is microseconds. Instead, a Clock with duration of 1 nanosecond should be used.

@jakelandis jakelandis added v7.3.0 and removed v7.2.0 labels Jun 17, 2019
@jpountz jpountz removed the v7.3.0 label Jul 5, 2019
@matriv matriv self-assigned this Nov 18, 2019
matriv added a commit to matriv/elasticsearch that referenced this issue May 3, 2020
Use an internal new DataType DATETIME_NANOS which is not exposed
and therefore cannot be used for CASTing. DATETIME is used instead
and the precision of both DATETIME and TIME has been promoted from
3 to 9, providing transparency to all datetime functionality regardless
of millis or nano precision.

Moreover, CURRENT_TIMESTAMP/CURRENT_TIME can now return precision up
to 6 fractional digits of a second with the use of Clock.

Closes: elastic#38562
@rjernst rjernst added the Team:QL (Deprecated) Meta label for query languages team label May 4, 2020
matriv added a commit to matriv/elasticsearch that referenced this issue Jan 19, 2021
Use an internal new DataType DATETIME_NANOS which is not exposed
and therefore cannot be used for CASTing. DATETIME is used instead
and the precision of both DATETIME and TIME has been promoted from
3 to 9, providing transparency to all datetime functionality regardless
of millis or nano precision.

Moreover, CURRENT_TIMESTAMP/CURRENT_TIME can now return precision up
to 6 fractional digits of a second with the use of Clock.

Closes: elastic#38562
matriv added a commit that referenced this issue Jan 29, 2021
Use an internal new DataType DATETIME_NANOS which is not exposed
and therefore cannot be used for CASTing. DATETIME is used instead
and the precision of both DATETIME and TIME has been promoted from
3 to 9, providing transparency to all datetime functionality regardless
of millis or nanos precision.

Moreover, CURRENT_TIMESTAMP/CURRENT_TIME can now return precision up
to 6 fractional digits of a second with the use of Clock.

Closes: #38562

Co-authored-by: Bogdan Pintea <bogdan.pintea@elastic.co>
matriv added a commit to matriv/elasticsearch that referenced this issue Jan 29, 2021
Use an internal new DataType DATETIME_NANOS which is not exposed
and therefore cannot be used for CASTing. DATETIME is used instead
and the precision of both DATETIME and TIME has been promoted from
3 to 9, providing transparency to all datetime functionality regardless
of millis or nanos precision.

Moreover, CURRENT_TIMESTAMP/CURRENT_TIME can now return precision up
to 6 fractional digits of a second with the use of Clock.

Closes: elastic#38562

Co-authored-by: Bogdan Pintea <bogdan.pintea@elastic.co>
(cherry picked from commit bbf3cbf)
matriv added a commit that referenced this issue Jan 29, 2021
* QL: Implement support for date_nanos ES type. (#67666)

Use an internal new DataType DATETIME_NANOS which is not exposed
and therefore cannot be used for CASTing. DATETIME is used instead
and the precision of both DATETIME and TIME has been promoted from
3 to 9, providing transparency to all datetime functionality regardless
of millis or nanos precision.

Moreover, CURRENT_TIMESTAMP/CURRENT_TIME can now return precision up
to 6 fractional digits of a second with the use of Clock.

Closes: #38562

Co-authored-by: Bogdan Pintea <bogdan.pintea@elastic.co>

(cherry picked from commit bbf3cbf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying >enhancement Team:QL (Deprecated) Meta label for query languages team
Projects
None yet
6 participants