lsyldliu commented on a change in pull request #11482: [FLINK-16581][table]
Minibatch deduplication lack state TTL bug fix
URL: https://github.com/apache/flink/pull/11482#discussion_r407214511
##########
File path:
flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/operators/deduplicate/MiniBatchDeduplicateKeepLastRowFunctionTest.java
##########
@@ -113,4 +113,42 @@ public void testWithGenerateRetraction() throws Exception
{
testHarness.close();
assertor.assertOutputEqualsSorted("output wrong.",
expectedOutput, testHarness.getOutput());
}
+
+ @Test
+ public void tesKeepLastRowWithStateTtlAndGenerateRetraction() throws
Exception {
+ MiniBatchDeduplicateKeepLastRowFunction func =
createFunction(true, minTime.toMilliseconds());
+ OneInputStreamOperatorTestHarness<BaseRow, BaseRow> testHarness
= createTestHarness(func);
+ testHarness.setup();
+ testHarness.open();
+
+ testHarness.processElement(record("book", 1L, 10));
+ testHarness.processElement(record("book", 2L, 11));
+ // output is empty because bundle not trigger yet.
+ Assert.assertTrue(testHarness.getOutput().isEmpty());
+ testHarness.processElement(record("book", 1L, 13));
+
+ testHarness.setStateTtlProcessingTime(30);
+ //Incremental cleanup is an eventual clean up, more state
access guarantee more expired state cleaned
+ for (long i = 3; i < 30; i++){
Review comment:
Yeah, I have tested it. When remove these code, the test failed. You can see
[FLINK-10473](https://issues.apache.org/jira/browse/FLINK-10473?focusedCommentId=17068492&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17068492)
for more explain.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services