lirui-apache commented on a change in pull request #13744:
URL: https://github.com/apache/flink/pull/13744#discussion_r512513851



##########
File path: 
flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/filesystem/stream/compact/CompactOperatorTest.java
##########
@@ -105,8 +105,63 @@ public void testCompactOperator() throws Exception {
                });
        }
 
+       @Test
+       public void testUnitSelection() throws Exception {
+               OneInputStreamOperatorTestHarness<CoordinatorOutput, 
PartitionCommitInfo> harness0 = create(2, 0);
+               harness0.setup();
+               harness0.open();
+
+               OneInputStreamOperatorTestHarness<CoordinatorOutput, 
PartitionCommitInfo> harness1 = create(2, 1);
+               harness1.setup();
+               harness1.open();
+
+               Path f0 = newFile(".uncompacted-f0", 3);
+               Path f1 = newFile(".uncompacted-f1", 2);
+               Path f2 = newFile(".uncompacted-f2", 2);
+               Path f3 = newFile(".uncompacted-f3", 5);
+               Path f4 = newFile(".uncompacted-f4", 1);
+               Path f5 = newFile(".uncompacted-f5", 5);
+               Path f6 = newFile(".uncompacted-f6", 4);
+               FileSystem fs = f0.getFileSystem();
+
+               // broadcast
+               harness0.processElement(new CompactionUnit(0, "p0", 
Arrays.asList(f0, f1, f4)), 0);
+               harness0.processElement(new CompactionUnit(1, "p0", 
Collections.singletonList(f3)), 0);
+               harness0.processElement(new CompactionUnit(2, "p0", 
Arrays.asList(f2, f5)), 0);
+               harness0.processElement(new CompactionUnit(3, "p0", 
Collections.singletonList(f6)), 0);
+
+               harness1.processElement(new CompactionUnit(0, "p0", 
Arrays.asList(f0, f1, f4)), 0);
+               harness1.processElement(new CompactionUnit(1, "p0", 
Collections.singletonList(f3)), 0);
+               harness1.processElement(new CompactionUnit(2, "p0", 
Arrays.asList(f2, f5)), 0);
+               harness1.processElement(new CompactionUnit(3, "p0", 
Collections.singletonList(f6)), 0);
+
+               harness0.processElement(new EndCompaction(1), 0);
+
+               // check all compacted file generated
+               Assert.assertTrue(fs.exists(new Path(folder, "compacted-f0")));
+               Assert.assertTrue(fs.exists(new Path(folder, "compacted-f2")));

Review comment:
       Also verify `f3` and `f6` are not compacted at this point.




----------------------------------------------------------------
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]


Reply via email to