datasketches-java icon indicating copy to clipboard operation
datasketches-java copied to clipboard

Provide a way to merge Kll sketches deterministically

Open thomasrebele opened this issue 1 month ago • 1 comments

As explained in https://github.com/apache/datasketches-java/issues/693, it would be very helpful for certain downstream projects to be able to use the KLL sketches, while still getting a deterministic result.

This PR proposes to add a method KllSketch#merge(KllSketch, Random) as an alternative. Existing code will continue to run as before. New callers can consider to use the newly added method if they need deterministic results. A warning has been added to the javadoc of the new method, to make it clear that the error guarantees of the KLL sketch algorithm might no longer be valid.

thomasrebele avatar Nov 24 '25 16:11 thomasrebele

I am not in favor of this behavior. It is nearly always the wrong thing for users to do.

jmalkin avatar Nov 24 '25 16:11 jmalkin