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

RexSimplify should remove IS NOT NULL check when LIKE comparison is present

    XMLWordPrintableJSON

Details

    Description

      Consider query like

      select r_reason_desc from reason
      where r_reason_desc is not null and r_reason_desc like '%child%' 
      

      where "r_reason_desc" is a nullable field.

      When RexSimplify::simplifyFilterPredicates is called on that conjunction of expressions, expression is not simplified, meaning that redundant  "is not null" check is not removed.

      In the same time, if query like 

      select r_reason_desc from reason
      where r_reason_desc is not null and r_reason_desc >= 'A'

      is passed to optimizer, redundant "is not null" check is eliminated.

      Attachments

        Issue Links

          Activity

            People

              lchistov1987 Leonid Chistov
              lchistov1987 Leonid Chistov
              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 - 3.5h
                  3.5h