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

Simplification may have not fully simplified IS NOT NULL expressions

    XMLWordPrintableJSON

Details

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

    Description

      CALCITE-2929 have added a safety check to avoid simplifying problematic cases.

      The safety check apparently misses some kinds, for example: UNARY_PLUS

        @Test public void testIsNullSimplificationWithUnaryPlus() {
          RexNode expr =
              isNotNull(coalesce(unaryPlus(vInt(1)), vIntNotNull(0)));
          RexNode s = simplify.simplifyUnknownAs(expr, RexUnknownAs.UNKNOWN);
      
          assertThat(expr.isAlwaysTrue(), is(true));
          assertThat(s, is(trueLiteral));
        }
      

      Attachments

        Issue Links

          Activity

            People

              kgyrtkirk Zoltan Haindrich
              kgyrtkirk Zoltan Haindrich
              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 - 40m
                  40m