Copilot commented on code in PR #19688:
URL: https://github.com/apache/druid/pull/19688#discussion_r3586722326
##########
extensions-contrib/druid-exact-count-bitmap/src/test/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeAggregatorTest.java:
##########
@@ -95,6 +95,29 @@ public void testAggregateMultipleCounters()
EasyMock.verify(mockSelector);
}
+
+ @Test
+ public void testAggregateCountersAcrossSignedHighBoundary()
+ {
+ RoaringBitmap64Counter negativeHighCounter = new RoaringBitmap64Counter();
+ negativeHighCounter.add(-1L);
+
+ RoaringBitmap64Counter nonNegativeHighCounter = new
RoaringBitmap64Counter();
+ nonNegativeHighCounter.add(0L);
+ nonNegativeHighCounter.add(1L);
+
+
EasyMock.expect(mockSelector.getObject()).andReturn(negativeHighCounter).once();
+
EasyMock.expect(mockSelector.getObject()).andReturn(nonNegativeHighCounter).once();
+ EasyMock.replay(mockSelector);
+
+ aggregator.aggregate();
+ aggregator.aggregate();
+
+ Bitmap64 resultCounter = (Bitmap64) aggregator.get();
+ Assertions.assertEquals(3, resultCounter.getCardinality());
Review Comment:
Add a null assertion for consistency with the other tests in this class (and
to make failures clearer if the aggregator unexpectedly returns null).
--
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]