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

Julian Hyde edited comment on CALCITE-5414 at 1/22/23 1:51 AM:
---------------------------------------------------------------

There are few comments such as
{quote}Converts a SQL TIMESTAMP value from the internal representation type 
(number of milliseconds since January 1st, 1970 UTC) to the Java Type 
"Timestamp".
{quote}
I plan to strike "UTC" from such comments because SQL TIMESTAMPS are local data 
times, not instants.

I am adding "in the local time zone" to the description of functions such as 
"toInt(java.sql.Date v)" because, as Calcite is often used as a server, using 
the local time zone is something that we want to be very wary of.


was (Author: julianhyde):
There are few comments such as
{quote}
Converts a SQL TIMESTAMP value from the internal representation type (number of 
milliseconds
since January 1st, 1970 UTC) to the Java Type ({@link Timestamp}).
{quote}

I plan to strike "UTC" from such comments because SQL TIMESTAMPS are local data 
times, not instants.

I am adding "in the local time zone" to the description of functions such as 
"toInt(java.sql.Date v)" because using the local time zone is something that we 
want to be very wary of.

> Use DateTimeUtils to correctly convert between java.sql types and unix 
> timestamps
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-5414
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5414
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.32.0
>            Reporter: Gregory Hart
>            Assignee: Gregory Hart
>            Priority: Major
>              Labels: pull-request-available, pull-requests-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Converting java.sql types to unix timestamps requires extra steps to also 
> convert to the correct calendar. Unix timestamps should follow the proleptic 
> Gregorian calendar as defined by ISO-8601. Java uses the standard Gregorian 
> calendar for java.sql types and switches to the Julian calendar for dates 
> before the Gregorian shift.
> The DateTimeUtils class in Avatica correctly handles the calendar 
> conversions. Calcite should use those methods since its own methods do not 
> currently convert between calendars.



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

Reply via email to