You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Zhenghua Gao (Jira)" <ji...@apache.org> on 2020/04/07 08:22:00 UTC
[jira] [Commented] (FLINK-16632) SqlDateTimeUtils#toSqlTimestamp(String, String) may yield incorrect result
[ https://issues.apache.org/jira/browse/FLINK-16632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17077035#comment-17077035 ]
Zhenghua Gao commented on FLINK-16632:
--------------------------------------
SqlDateTimeUtils#toSqlTimestamp(String, String) may yield incorrect result. Which cause:
1) cast STRING to TIMESTAMP yields incompatible result.
The original result comes from DateTimeUtils#timestampStringToUnixDate which supports special cases
like '1999-9-10 05:20:10' or '1999-9-10'.
2) TO_TIMESTAMP yields incorrect result.
The original result comes from SqlDateTimeUtils#toTimestamp(String, String, TimeZone) which follows rules of completion of java.text.SimpleDateFormat
Will file a PR to fix this
> SqlDateTimeUtils#toSqlTimestamp(String, String) may yield incorrect result
> --------------------------------------------------------------------------
>
> Key: FLINK-16632
> URL: https://issues.apache.org/jira/browse/FLINK-16632
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Reporter: Jingsong Lee
> Assignee: Zhenghua Gao
> Priority: Critical
> Fix For: 1.10.1, 1.11.0
>
> Attachments: image-2020-04-03-15-39-35-702.png
>
>
> Legacy planner support SQL: "CAST('1999-9-10' AS TIMESTAMP)".
> Blink planner loose this support after timestamp precision support.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)