You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/06/29 18:47:00 UTC

[jira] [Resolved] (CALCITE-2281) TIMESTAMPADD(MICROSECOND, ...) returns incorrect results

     [ https://issues.apache.org/jira/browse/CALCITE-2281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-2281.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.17.0

Fixed in [44f73389|http://git-wip-us.apache.org/repos/asf/calcite/commit/44f73389]. Thanks [~sudheeshkatkam] for the patch that was the starting point. I did a significant amount of work to make it product quality.

> TIMESTAMPADD(MICROSECOND, ...) returns incorrect results
> --------------------------------------------------------
>
>                 Key: CALCITE-2281
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2281
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Sudheesh Katkam
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.17.0
>
>         Attachments: CALCITE-2281.patch.txt
>
>
> Add this test to {{SqlOperatorBaseTest#testTimestampAdd}} :
> {code:java}
> tester.checkScalar(
>     "timestampadd(MICROSECOND, 2, timestamp '2016-02-24 12:42:25.000000')",
>     "2016-02-24 12:42:25.000002",
>     "TIMESTAMP(6) NOT NULL");{code}
> {{[SqlTimestampAddFunction|https://github.com/apache/calcite/blob/8327e674e7f0a768d124fa37fd75cda4b8a35bb6/core/src/main/java/org/apache/calcite/sql/fun/SqlTimestampAddFunction.java#L68]}} has incorrect precision for MILLISECOND and MICROSECOND. Note that the parser does not allow for MILLISECOND as a time unit.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)