[
https://issues.apache.org/jira/browse/CALCITE-5266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603139#comment-17603139
]
Julian Hyde commented on CALCITE-5266:
--------------------------------------
I agree, the Postgres solution is too unpredictable for Calcite users.
The simplest thing for us might be to use Java BigInteger internally to
represent the decimal digits of the nanosecond value. We can do date arithmetic
on that value (e.g. adding an interval, or subtracting two TIMESTAMP values).
We could do the same for large precision fixed point numbers.
Avatica might need a different solution. We don’t want Avatica clients to have
to deal with shifted decimals.
> 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)