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

Julian Hyde commented on CALCITE-5308:
--------------------------------------

I'm not sure whether "support for microsecond precision timestamps" and 
"support timestamps with timezone" are best solved as one bug or two. Let's see 
how it pans out.

Regarding the microsecond precision. I believe we currently send an integer, 
which is milliseconds. For example the integer {{86400123}} represents the 
timestamp {{{}"1970-01-02 00:00:00.123"{}}}. Could we instead send a string 
that contains a number, which could be a decimal, but is still interpreted as 
milliseconds? For example the string {{"86400123.456"}} represents the 
timestamp {{{}"1970-01-02 00:00:00.123456"{}}}.

Can you sketch out the code that the client would write in order to get those 
microseconds? Would they need to call 
[Connection.setTypeMap|https://docs.oracle.com/javase/tutorial/jdbc/basics/sqlcustommapping.html]?

> Add support to Avatica for microsecond-precision timestamps (with timezone)
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-5308
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5308
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Will Noble
>            Priority: Minor
>
> Avatica [serializes 
> timestamps|https://github.com/apache/calcite-avatica/blob/9dfc5cad3efe72e9b14513b15a988ba86ab5a4ea/core/src/main/java/org/apache/calcite/avatica/remote/TypedValue.java#L447]
>  as the integer number of milliseconds since epoch. We would like support for 
> microsecond precision, although we only need it for 
> {{TIMESTAMP_WITH_LOCAL_TIME_ZONE}}, which is currently lacking proper support 
> (The recommended corresponding Java type as per [the 
> spec|https://download.oracle.com/otn-pub/jcp/jdbc-4_2-mrel2-spec/jdbc4.2-fr-spec.pdf?AuthParam=1664936014_d36468601dd3a115d7d95c975043ff3a]
>  is {{java.time.OffsetDateTime}}).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to