davecromberge commented on code in PR #13020: URL: https://github.com/apache/pinot/pull/13020#discussion_r1585986210
########## pinot-segment-local/src/test/java/org/apache/pinot/segment/local/aggregator/DistinctCountCPCSketchValueAggregatorTest.java: ########## @@ -34,19 +34,18 @@ public class DistinctCountCPCSketchValueAggregatorTest { @Test public void initialShouldCreateSingleItemSketch() { DistinctCountCPCSketchValueAggregator agg = new DistinctCountCPCSketchValueAggregator(Collections.emptyList()); - assertEquals(agg.getInitialAggregatedValue("hello world").getEstimate(), 1.0); + assertEquals(toSketch(agg.getInitialAggregatedValue("hello world")).getEstimate(), 1.0); } @Test public void initialShouldParseASketch() { - CpcSketch input = new CpcSketch(); - IntStream.range(0, 1000).forEach(input::update); + CpcSketch input = new CpcSketch(12); + IntStream.range(0, 100).forEach(input::update); Review Comment: The sketch estimate was off by one on the previous configuration. Rather than introducing a delta for the variable error, I decreased the number of inputs making the test more deterministic. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org