You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Marios Trivyzas (Jira)" <ji...@apache.org> on 2021/10/04 16:16:00 UTC

[jira] [Commented] (FLINK-24421) Casting from a string to a DATE and TIME allows incomplete strings

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

Marios Trivyzas commented on FLINK-24421:
-----------------------------------------

We checked with calcite-avatica's [https://github.com/apache/calcite-avatica/blob/master/core/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java] file where the relevant code was copied from into the `SqlDateTimeUtils` and we decided to keep the behaviour as is to be in sync with calcite.

 

Moreover there was a fix in avatica: [https://github.com/apache/calcite-avatica/commit/cac2ffaaf97572d21cba195d7590d9ab0d32382e] which is not ported to `SqkDateTimeUtils` currently but will soon open the PR to do so.

> Casting from a string to a DATE and TIME allows incomplete strings
> ------------------------------------------------------------------
>
>                 Key: FLINK-24421
>                 URL: https://issues.apache.org/jira/browse/FLINK-24421
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Marios Trivyzas
>            Assignee: Marios Trivyzas
>            Priority: Major
>
> The following 2 examples are allowed and produce weird DATE and TIME result objects where normally they should fail.
> *.from(STRING(), "123").resultsIn(LocalDate.of(123, 1, 1))*
> *.from(STRING(), "123").resultsIn(LocalTime.of(23, 1, 1))*



--
This message was sent by Atlassian Jira
(v8.3.4#803005)