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

Improve simplification of "expression IS TRUE"

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.27.0
    • Component/s: None

      Description

      When simplifying "expression IS TRUE", RexSimplify should simplify "expression" in an "unknown as FALSE" context, and this should allow more simplifications than at present.

      Currently "(x LIKE '%') IS TRUE" simplifies to "(x IS NOT NULL) IS TRUE", but after this change will simplify to "x IS NOT NULL". The following test illustrates:

          final RexNode ref = input(tVarchar(true, 10), 0);
          checkSimplify(isTrue(like(ref, literal("%"))), "IS NOT NULL($0)");
      

      Similarly "IS FALSE", "IS NOT TRUE", etc.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                julianhyde Julian Hyde
              • Votes:
                0 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 - 20m
                  20m