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

Kenneth Knowles edited comment on CALCITE-2394 at 7/2/18 7:10 PM:
------------------------------------------------------------------

Not to say that such a thing is without a _shared point of reference_, which is 
essentially universally 1970-01-01 00:00:00Z. But, the pertinent 
characteristics:
 # It is _not_ parameterized by any additional data such as a timezone provided 
at retrieval time.
 # No timezone is stored.

It is entirely possible that my experience w/ misc. RDBMSes has left me with a 
gap in understanding of what the SQL standard actually says.


was (Author: kenn):
Not to say that such a thing is without a _shared point of reference_, which is 
essentially universally 1970-01-01 00:00:00Z. But, the pertinent 
characteristics:

 
 # It is _not_ parameterized by any additional data such as a timezone provided 
at retrieval time.
 # No timezone is stored.

It is entirely possible that my experience w/ misc. RDBMSes has left me with a 
gap in understanding of what the SQL standard actually says.

> Avatica applies calendar offset to timestamps when they should remain 
> unchanged
> -------------------------------------------------------------------------------
>
>                 Key: CALCITE-2394
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2394
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>            Reporter: Kenneth Knowles
>            Assignee: Kenneth Knowles
>            Priority: Major
>
> This code converts a millis-since-epoch value to a timestamp in three 
> different accessors:
> {code}
> class AbstractCursor {
>   ...
>   static Timestamp longToTimestamp(long v, Calendar calendar) {
>     if (calendar != null) {
>       v -= calendar.getTimeZone().getOffset(v);
>     }
>     return new Timestamp(v);
>   }
> }
> {code}
> But {{new Timestamp(millis)}} always accepts millis-since-epoch in GMT.
> The use in {{DateFromNumberAccessor}} is probably OK: it fabricates 
> millis-since-epoch from a date, so applying the offset is appropriate to hit 
> midnight in that locale.
> But both {{TimeFromNumberAccessor}} and {{TimestampFromNumberAccessor}} 
> should leave the millis absolute.
> This manifests as timestamp actual values being shifted by the current locale 
> (in addition to later display adjustments).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to