c-dickens commented on code in PR #582:
URL: https://github.com/apache/datasketches-java/pull/582#discussion_r1679615193


##########
src/test/java/org/apache/datasketches/filters/quotientfilter/QuotientFilterTest.java:
##########
@@ -308,4 +309,57 @@ public void expansion() {
       assertTrue(positives < 6);
     }
 
+    @Test
+    public void mergeEmpty() {
+      final QuotientFilter qf1 = new QuotientFilter(4, 3);
+      final QuotientFilter qf2 = new QuotientFilter(4, 3);
+      qf1.merge(qf2);
+
+      assertEquals(qf1.getLgQ(), 4);
+      assertEquals(qf1.getFingerprintLength(), 3);
+      assertEquals(qf1.getNumEntries(), 0);
+    }
+
+    @Test
+    public void merge() {
+      final QuotientFilter qf1 = new QuotientFilter(16, 13);
+      final QuotientFilter qf2 = new QuotientFilter(16, 13);
+      final int n = 50000;
+      for (int i = 0; i < n / 2; i++) {
+        qf1.insert(i);
+        qf1.insert(i + n / 2);

Review Comment:
   should this be `qf2.insert(i + n/2)`?
   Otherwise there are not items in `qf2` so we merge empty sketches as in the 
above test.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to