Skip to content

prep for 5.0.2, fix KllItemsSketch level 0 sorting issue - #529

Merged
jmalkin merged 1 commit into
5.0.Xfrom
5.0.X-patch
Mar 14, 2024
Merged

jmalkin merged 1 commit into
5.0.Xfrom
5.0.X-patch

Conversation

@jmalkin

@jmalkin jmalkin commented Mar 14, 2024

Copy link
Copy Markdown
Contributor

Bumped the version in the pom, too, since that'll need to be done to push out the patch anyway

@jmalkin
jmalkin requested a review from leerho March 14, 2024 06:17
@jmalkin
jmalkin merged commit ba29502 into 5.0.X Mar 14, 2024
@jmalkin
jmalkin deleted the 5.0.X-patch branch March 14, 2024 21:02
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants