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

((A IS NOT NULL OR B) AND A IS NOT NULL) can't be simplify to (A IS NOT NULL) When A is deterministic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Resolved
    • 1.29.0
    • 1.30.0
    • None

    Description

      Now In Calcite:

      ((A IS NOT NULL OR B) AND A) can be simplify to (A)

      When A is a node representing an input reference or field access.

      For example:

      (name is null or empid = 1) and name is nul -> name is null

      But When A is a deterministic node, It can't reduce.

      For example:

      (replace(name,'e','a') is not null or replace(name,'a','c') is not null) 
      and replace(name,'e','a') is not null

      Can't be simplify to:

      replace(name,'e','a') is not null

      This issue originated in CALCITE-4910.

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              nobigo xiong duan
              Votes:
              1 Vote for this issue
              Watchers:
              4 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