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

Simplify casts which are only widening nullability

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.18.0
    • None
    • None

    Description

      There are cases in which casts are added; but they are not neccessary.

        @Test public void testSimplifyRedundantCast() {
          RexNode expr = cast(isTrue(vBoolNotNull()), tBoolean(true));
          assertThat(expr.getType().isNullable(), is(true));
          RexNode result = simplify.simplifyUnknownAs(expr, RexUnknownAs.UNKNOWN);
          assertThat(result.getType().isNullable(), is(false));
        }
      

      Attachments

        Issue Links

          Activity

            People

              kgyrtkirk Zoltan Haindrich
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: