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

Simplify '1 > x OR 1 <= x OR x IS NULL' to TRUE

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.34.0
    • 1.35.0
    • core

    Description

      The following expressions which contain reverse order comparison are always true:

      1 > x or 1 <= x or x is null
      1 < x or 1 >= x or x is null
      1 > x or 0 < x or x is null
      

      But currently these expressions are not fully simplified to TRUE, the current simplified results are SEARCH operator.

      The root cause is that RexSimplify doesn't identify these cases and makes targeted simplification.

      It would be nice if RexSimplify.simplifyOr handled these cases.

      Attachments

        Issue Links

          Activity

            People

              Runking Runkang He
              Runking Runkang He
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: