[ 
https://issues.apache.org/jira/browse/CALCITE-5266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603005#comment-17603005
 ] 

Dmitry Sysolyatin edited comment on CALCITE-5266 at 9/12/22 9:07 AM:
---------------------------------------------------------------------

[~julianhyde] Good point. 

Also I think that long can still be used if a user uses TIMESTAMP(3). 
TIMESTAMP(6) can be also implemented using Long, but I don't think that it is 
good idea. For example PostgreSQL has TIMESTAMP(6) implementation that uses 
Long, but those timestamps starts from 2000-01-01 and precision degrades for 
dates further away from 2000-01-01 
([https://www.postgresql.org/docs/7.3/datatype-datetime.html]).


was (Author: dmsysolyatin):
[~julianhyde] Good point. I also think that long can still be used if a user 
uses TIMESTAMP(3). TIMESTAMP(6) can be also implemented using Long, but I don't 
think that it is good idea. For example PostgreSQL has TIMESTAMP(6) 
implementation that uses Long, but those timestamps starts from 2000-01-01 and 
precision degrades for dates further away from 2000-01-01 
(https://www.postgresql.org/docs/7.3/datatype-datetime.html).

> 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)

Reply via email to