Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2332

Wrong simplification of FLOOR(CEIL(x)) to FLOOR(x)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.17.0
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcamachorodriguez Jesus Camacho Rodriguez
                Reporter:
                julianhyde Julian Hyde
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: