[
https://issues.apache.org/jira/browse/CALCITE-5266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18110820#comment-18110820
]
Aleksandr Efimov commented on CALCITE-5266:
-------------------------------------------
[~mbudiu], [~julianhyde], yeah, my bad - that was unreadable, and it skipped
the condition it rests on: the default type system caps datetime precision at 3.
Raise that cap and the type and the literal do keep the digits - a plan holds
{{13:30:25.575401:TIME(6)}} - but execution still gets the literal as
{{TimeString.getMillisOfDay()}}, so the query return 13:30:25.575000 and
{{EXTRACT(MICROSECOND ...)}} folds to 25575000.
The loss that is left is in the value, not in the type.
> Increase precision of TIMESTAMP, INTERVAL types to microseconds, nanoseconds
> ----------------------------------------------------------------------------
>
> Key: CALCITE-5266
> URL: https://issues.apache.org/jira/browse/CALCITE-5266
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Dmitry Sysolyatin
> Priority: Major
>
> TIMESTAMP, INTERVAL types can preserve only milliseconds, because internal
> TIMESTAMP representation is Long. But it would be good to extend precision to
> microseconds and nanoseconds.
> I suggest to use standard java.time classes for representing TIMESTAMP and
> INTERVAL type internally:
> # TIMESTAMP type can be represent like java.time.Instant
> # INTERVAL type can be represent like java.time.Period + java.time.Duration
> What do you guys think ?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)