[
https://issues.apache.org/jira/browse/CALCITE-4313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17209151#comment-17209151
]
Nils Braun commented on CALCITE-4313:
-------------------------------------
Yes, the documentation seems to be correct. From the [SQL 1992
standard|http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt]:
"the time and timestamp values are returned with time zone displacement equal
to the current time zone displacement of the SQL-session"
"The data type of a <current date value function> is DATE. The data type of a
<current time value function> is TIME WITH TIME ZONE. The data type of a
<current timestamp value function> is TIMESTAMP WITH TIME ZONE."
Also postgreSQL seems to implement it with the _WITH_LOCAL_ZONE type: [postgres
documentation|https://www.postgresql.org/docs/8.2/functions-datetime.html]
> Date functions CURRENT_* have type different from documentation
> ---------------------------------------------------------------
>
> Key: CALCITE-4313
> URL: https://issues.apache.org/jira/browse/CALCITE-4313
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.26.0
> Reporter: Nils Braun
> Priority: Minor
>
> The return types of the {{CURRENT_TIME}}, {{CURRENT_DATE}} and
> {{CURRENT_TIMESTAMP}} operations set in the SqlStdOperatorTable.java (e.g.
> [here|#L1882]) is different from the
> [documentation|https://calcite.apache.org/docs/reference.html#datetime-functions]:
> they are missing the {{_WITH_LOCAL_TIMEZONE}}.
> I am not an expert, but I think changing them to
> {{TIME_WITH_LOCAL_TIME_ZONE}} will already do the trick. I am happy to do a
> PR, if this is really the only thing to do.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)