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

RexSimplify/Sarg incorrectly simplifies complex expressions with NULL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.26.0
    • 1.27.0
    • core
    • 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

              julianhyde Julian Hyde
              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