You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Lim Qing Wei (Jira)" <ji...@apache.org> on 2022/07/04 13:26:00 UTC

[jira] [Comment Edited] (FLINK-28365) TO_TIMESTAMP lose precision beyond seconds

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

Lim Qing Wei edited comment on FLINK-28365 at 7/4/22 1:25 PM:
--------------------------------------------------------------

Hi, sorry for creating PR for it.

 

-It returns something more precise in Flink 1.14.-

We are using TO_TIMESTAMP in 1.14 where it returns TIMESTAMP with up to 9 precision. I will try to provide a small reproduction and get back to you.

-I guess we can argue it was an unspecified behavior though. I am happy if you think we should close this ticket.-

 

Edit: I misread and wrote something useless...


was (Author: JIRAUSER289353):
Hi, sorry for creating PR for it.

 

It returns something more precise in Flink 1.14.

We are using TO_TIMESTAMP in 1.14 where it returns TIMESTAMP with up to 9 precision.

I guess we can argue it was an unspecified behavior though. I am happy if you think we should close this ticket.

> TO_TIMESTAMP lose precision beyond seconds
> ------------------------------------------
>
>                 Key: FLINK-28365
>                 URL: https://issues.apache.org/jira/browse/FLINK-28365
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.16.0, 1.15
>            Reporter: Lim Qing Wei
>            Priority: Major
>             Fix For: 1.16.0, 1.15
>
>
> The TO_TIMESTAMP function in Flink SQL seems to have a regression.
>  
> It loses the precision after seconds, for example
>  
> {code:java}
> TO_TIMESTAMP('2020-01-01 15:35:00.123456'){code}
> returns 2020-01-01 15:35:00.123 in the resulting SQL AST, note that the last 3 digit are missing.
>  
> I think this started in 1.15.x, because I have code in 1.14 that preserve the precision as I expect.
>  
> Do you agree this is a bug?
> PS: The documentation isn't very comprehensive: [https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/systemfunctions/]
>  
> I've added a few assertions to illustrate the issue: [https://github.com/apache/flink/pull/20139]
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)