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

RexSimplify optimization error for expression 'x is not null and x <> 5'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.16.0
    • Fix Version/s: 1.17.0
    • Component/s: core
    • Labels:
      None

      Description

         After the optimization of RexSimplify,the expression 'x is not null and x <> 5' (x is nullable) is optimized to 'x<> 5' (RexSimplify#unknownAsFalse is true).  I think it is not a correct result because when x is null, null<> 5 should return true,while 'x is not null and x <> 5' return false.

        I think the optimization for "is not null" in RexSimplify#simplifyAnd2ForUnknownAsFalse should exclude the case of not-equal operator.

       I really confused with this optimization, can you give some suggestion,thanks! 

       

        

               

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              pzw2018 pengzhiwei
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: