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

RexSimplify/Sarg incorrectly simplifies complex expressions with NULL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.26.0
    • Fix Version/s: 1.27.0
    • Component/s: core
    • Environment:

      All environments

      Description

      In Calcite 1.26, the Rex expressions like follows:

      (deptno = 20 OR deptno IS NULL) AND deptno = 10

      Are simplified to:

      deptno IS NULL

      Instead of:

      FALSE

      Similarly, the following expression:

      (deptno <> 20 OR deptno IS NULL) AND deptno = 10

      Is simplified to:

      deptno = 10 OR deptno IS NULL

      Instead of:

      deptno = 10

      A diff with related unit tests (for RelBuilderTest.java) is in the attachment.

        Attachments

        1. rex-simplify-issue-tests-2.patch
          3 kB
          Igor Lozynskyi

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                aigor Igor Lozynskyi
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m