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

Simplify casts which are only widening nullability

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.18.0
    • Component/s: None
    • Labels:
      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

            • Assignee:
              kgyrtkirk Zoltan Haindrich
              Reporter:
              kgyrtkirk Zoltan Haindrich

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment