Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20271

Fix ArrayIndexOutOfBounds for RetractableTopNFunction

    XMLWordPrintableJSON

Details

    Description

      We can get the bug by adding the case into the UnitTest RetractableTopNFunctionTest

      // Some comments here
      	@Test
      	public void testCornerCase() throws Exception {
      		AbstractTopNFunction func = createFunction(RankType.ROW_NUMBER, new ConstantRankRange(1, 3), false,
      				false);
      		OneInputStreamOperatorTestHarness<RowData, RowData> testHarness = createTestHarness(func);
      		testHarness.open();
      		testHarness.processElement(insertRecord("a", 1L, 1));
      		testHarness.processElement(insertRecord("a", 2L, 2));
      		testHarness.processElement(insertRecord("a", 3L, 2));
      		testHarness.processElement(insertRecord("a", 4L, 2));
      		testHarness.processElement(insertRecord("a", 5L, 3));
      		testHarness.processElement(insertRecord("a", 6L, 4));
      		testHarness.processElement(updateBeforeRecord("a", 2L, 2));
      		testHarness.close();
      	}
      

      Attachments

        Issue Links

          Activity

            People

              jark Jark Wu
              fsk119 Shengkai Fang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: