yunlou11 commented on code in PR #5730:
URL: https://github.com/apache/paimon/pull/5730#discussion_r2165337697


##########
paimon-core/src/test/java/org/apache/paimon/mergetree/compact/LookupChangelogMergeFunctionWrapperTest.java:
##########
@@ -547,4 +551,80 @@ public void testKeepLowestHighLevel() {
         kv = result.result();
         assertThat(kv.value().getInt(0)).isEqualTo(3);
     }
+
+    @Test
+    public void testWithDeletionVectorsMaintainer() {
+        IndexFileHandler indexFileHandler =
+                new IndexFileHandler(
+                        null,
+                        null,
+                        null,
+                        null,
+                        new DeletionVectorsIndexFile(null, null, null, true));
+        DeletionVectorsMaintainer dvMaintainer =
+                DeletionVectorsMaintainer.factory(indexFileHandler).create();
+        Map<InternalRow, LookupLevels.PositionedKeyValue> lookup = new 
HashMap<>();
+        LookupChangelogMergeFunctionWrapper function =
+                new LookupChangelogMergeFunctionWrapper(
+                        
LookupMergeFunction.wrap(DeduplicateMergeFunction.factory()),
+                        lookup::get,
+                        EQUALISER,
+                        LookupStrategy.from(false, true, true, true),
+                        dvMaintainer,
+                        null);
+
+        // With level-0, with level-x in lookup, with level-x deleted in 
dvMaintainer
+        function.reset();
+        LookupLevels.PositionedKeyValue positionedKv =
+                new LookupLevels.PositionedKeyValue(
+                        new KeyValue().replace(row(1), 1, INSERT, 
row(2)).setLevel(5), "f1", 1);
+        lookup.put(row(1), positionedKv);
+        // Simulation scenario: (file:"f1", pos: 1) has been deleted
+        dvMaintainer.notifyNewDeletion("f1", 1);
+        function.add(new KeyValue().replace(row(1), 2, INSERT, 
row(2)).setLevel(0));
+        // notifyNewDeletion will return 'false' because (file:"f1", pos: 1) 
has been deleted
+        ChangelogResult result = function.getResult();

Review Comment:
   @wwj6591812  Here will be return false of notifyNewDeletion be called inside 
"function.getResult()".



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

To unsubscribe, e-mail: issues-unsubscr...@paimon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to