You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2025/05/07 08:30:00 UTC
[jira] [Assigned] (CALCITE-7001) Cast of malformed literal to TIMESTAMP WITH LOCAL TIME ZONE need to throw informative error
[ https://issues.apache.org/jira/browse/CALCITE-7001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Evgeny Stanilovsky reassigned CALCITE-7001:
-------------------------------------------
Assignee: Evgeny Stanilovsky
> Cast of malformed literal to TIMESTAMP WITH LOCAL TIME ZONE need to throw informative error
> --------------------------------------------------------------------------------------------
>
> Key: CALCITE-7001
> URL: https://issues.apache.org/jira/browse/CALCITE-7001
> Project: Calcite
> Issue Type: Task
> Components: core
> Affects Versions: 1.39.0
> Reporter: Evgeny Stanilovsky
> Assignee: Evgeny Stanilovsky
> Priority: Major
>
> Query like :
> {noformat}
> select TIMESTAMP WITH LOCAL TIME ZONE '0000-01-01 00:00:00';
> or
> select TIMESTAMP WITH LOCAL TIME ZONE 'malformed';
> {noformat}
> will throw smth like:
> {noformat}
> Illegal TIMESTAMP WITH LOCAL TIME ZONE literal '0000-01-01 00:00:00': not in format 'yyyy-MM-dd HH:mm:ss'
> {noformat}
> but
> {noformat}
> select cast ('malformed' AS TIMESTAMP WITH LOCAL TIME ZONE);
> {noformat}
> will throw:
> with jdk21
> {noformat}
> Caused by: java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 19
> {noformat}
> and
> with jdk11
> {noformat}
> StringIndexOutOfBoundsException: begin 0, end -1, length 20
> {noformat}
> Seems this NON-informative error need to be aligned with upper case
--
This message was sent by Atlassian Jira
(v8.20.10#820010)