Repository navigation
prep for 5.0.2, fix KllItemsSketch level 0 sorting issue - #529
Merged
Merged
Conversation
leerho
approved these changes
Mar 14, 2024
proost
pushed a commit
to proost/datasketches-java
that referenced
this pull request
Oct 11, 2026
A purge can remove every counter while the stream weight and offset stay positive. isEmpty() treated that state as empty, so toByteArray() wrote the 8-byte empty form (losing stream weight and offset) and merge() ignored the other sketch. Parallels apache/datasketches-cpp#527 and apache#529. - isEmpty() returns streamWeight == 0 in FrequentLongsSketch and FrequentItemsSketch. - toByteArray() handles a non-empty sketch with no active items: full preamble, no values or keys. - getInstance(MemorySegment): emptiness is determined by PreLongs; the empty flag is only cross-checked. Reject a non-empty image whose stream weight is not positive. - FrequentLongsSketch string form: flags from isEmpty(); getInstance(String) masks the flag with EMPTY_FLAG_MASK, requires it to agree with the stream weight, and accepts a non-empty sketch with no active items. - PreambleUtil: document emptiness and the flags byte; remove unused SER_DE_ID_SHORT. - Cross-language: generate and check purged-to-zero images; checkCpp() now reads the C++ ascii and utf8 images instead of the Java ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumped the version in the pom, too, since that'll need to be done to push out the patch anyway