[
https://issues.apache.org/jira/browse/CALCITE-7001?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mihai Budiu resolved CALCITE-7001.
----------------------------------
Fix Version/s: 1.40.0
Resolution: Fixed
Fixed in
[https://github.com/apache/calcite/commit/4ee33c9488740e41311c51735538dbac9e5abc4d]
Thank you for the fix [~zstan]
Thank you for the [~xuzifu666] [~jensen]
> 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
> Labels: pull-request-available
> Fix For: 1.40.0
>
>
> 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)