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

Julian Hyde commented on CALCITE-5538:
--------------------------------------

I agree that disallowing the trailing zero is a bug. However, I would frame 
this bug in terms of SQL parser capabilities, not the {{TimestampString}} 
class. Can you edit the summary and description?

The SQL parser is very well unit tested. I don't think that the 
{{TimestampString}} class needs unit tests.

I'm not sure whether standard SQL allows negative years in DATE or TIMESTAMP 
values. Can you provide evidence?

> Calcite rejects timestamp literals that end with 0 after the period
> -------------------------------------------------------------------
>
>                 Key: CALCITE-5538
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5538
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.33.0
>            Reporter: Mihai Budiu
>            Priority: Trivial
>
> The TimestampString constructor validates a string argument with the 
> following regular expression: "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]"
>           + " "
>           + "[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\\.[0-9]*[1-9])?"
> Unfortunately this rejects perfectly legal timestamp strings such as 
> "2023-02-21 10:10:10.000".
> The fix is trivial, if we agree that this is a bug. Is there a deeper reason 
> for this validation?
> There seem to be no unit tests for this TimestampString constructor.



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

Reply via email to