[
https://issues.apache.org/jira/browse/CALCITE-6062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778168#comment-17778168
]
Julian Hyde commented on CALCITE-6062:
--------------------------------------
It sounds reasonable, but can we focus the discussion on SQL syntax and
semantics, rather than on implementation code. What SQL syntax would perform
this conversion? Are there any other databases that support this already?
> Allow conversion of un-zoned timestamp strings to timestamp with local time
> zone
> --------------------------------------------------------------------------------
>
> Key: CALCITE-6062
> URL: https://issues.apache.org/jira/browse/CALCITE-6062
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Will Noble
> Priority: Minor
>
> [This
> function|https://github.com/apache/calcite/blob/ce88348960e95e1c13da850b4422b2f49f022d93/core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java#L4333]
> that implements conversion from strings to {{TIMESTAMP WITH LOCAL TIME
> ZONE}} uses {{TimestampWithTimeZoneString}}, which seems to have been a
> subtle mistake.
> That function is only used to implement {{CAST}} expressions from strings to
> TS w/ LTZ. Those expressions should allow for strings that do not have a time
> zone, e.g. {{CAST('2023-10-19 12:00:00' AS TIMESTAMP WITH LOCAL TIME ZONE)}},
> but it currently cannot because the {{TimestampWithTimeZoneString}} class
> always expects a string with a time zone on the end.
> In the case that no zone is included in the string, we should assume that the
> string expresses a timestamp in the data context time zone by default.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)