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

In RexWindow, make fields upperBound and lowerBound not-nullable

    XMLWordPrintableJSON

Details

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

    Description

      Null lowerBound/upperBond in RexWindow causes NPE in RexShuttle. Here's a test that can be dropped into RexShuttleTest.java: 

      @Test public void handlesNullBoundsInRexWindow() {
        final RelBuilder builder = RelBuilder.create(RelBuilderTest.config().build());
        final RexNode over = builder.getRexBuilder().makeOver(
            builder.getTypeFactory().createSqlType(SqlTypeName.BIGINT),
            SqlStdOperatorTable.ROW_NUMBER,
            ImmutableList.of(),
            ImmutableList.of(),
            ImmutableList.of(),
            null,
            null,
            true,
            true,
            true,
            true,
             true
        );
        assertThat(over.accept(new RexShuttle()), is(over));
      }
      

      That will raise an NPE. Fix is to handle NULLs when doing the child accept on the RexWindowBound[s] in RexShuttle.visitWindow.

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              swtalbot Steven Talbot
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: