You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2018/05/29 22:46:00 UTC

[jira] [Resolved] (CALCITE-2332) Wrong simplification of FLOOR(CEIL(x)) to FLOOR(x)

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

Jesus Camacho Rodriguez resolved CALCITE-2332.
----------------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.17.0

Fixed this issue in http://git-wip-us.apache.org/repos/asf/calcite/commit/76fd6c4 , logic was incorrect indeed. Created CALCITE-2334 as a follow-up to add simplification of CEIL functions.

> Wrong simplification of FLOOR(CEIL(x)) to FLOOR(x)
> --------------------------------------------------
>
>                 Key: CALCITE-2332
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2332
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>             Fix For: 1.17.0
>
>
> It's not valid to simplify {{FLOOR(CEIL\(x))}} to {{FLOOR\(x)}}.
> Specifically, it is not valid to simplify {{FLOOR(CEIL(x TO YEAR) TO YEAR)}} to {{FLOOR(x TO YEAR)}} when {{x}} is {{TIMESTAMP '2010-10-10 00:00:00'}}. I believe the correct simplification is {{CEIL(x TO YEAR)}}.
> I have disabled {{RexImplicationCheckerTest.testSimplifyFloor}} due to this issue. Please re-enable it as part of the fix for this bug.



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