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

Infer IS NOT NULL, and project predicates

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.11.0
    • None
    • None

    Description

      RexImplicationChecker makes some mistakes when OR is on the left-hand size or AND is on the right-hand side. The following 3 tests should all succeed, but all currently give the wrong result. I intend to check in the tests with my fix for CALCITE-1483 (coming soon, currently in my branch https://github.com/julianhyde/calcite/tree/1483-not-in-not-null).

          // "s is not null or i = 5" does not imply "s is not null"
          f.checkNotImplies(f.or(sIsNotNull, iEq5), sIsNotNull);
      
          // "s is not null" implies "s is not null or i = 5"
          f.checkImplies(sIsNotNull, f.or(sIsNotNull, iEq5));
      
          // "s is not null" implies "i = 5 or s is not null"
          f.checkImplies(sIsNotNull, f.or(iEq5, sIsNotNull));
      

      Amogh Margoor, Can you comment on these?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            julianhyde Julian Hyde
            julianhyde Julian Hyde
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment