Skip to content

feat: add exact equality for Jaccard sketches - #181

Merged
tisonkun merged 3 commits into
apache:mainfrom
hawkingrei:feat/jaccard-exactly-equal
Aug 5, 2026
Merged

feat: add exact equality for Jaccard sketches#181
tisonkun merged 3 commits into
apache:mainfrom
hawkingrei:feat/jaccard-exactly-equal

Conversation

@hawkingrei

Copy link
Copy Markdown
Contributor

What changed

  • Add exactly_equal to ThetaJaccardSimilarity and TupleJaccardSimilarity.
  • Reuse the key-only union path to compare retained hashes and theta.
  • Keep Tuple summary values and types outside the equality comparison.
  • Cover empty, mutable/compact, seed mismatch, summary-independent, and zero-retained cases.

Why

This is a focused follow-up to #142 and its final review feedback. It adds only exact sketch-state equality; similarity_test and dissimilarity_test remain separate future work.

The zero-retained case intentionally distinguishes the two APIs: compute preserves an uncertain Jaccard interval, while exactly_equal compares the observable sketch state (retained hashes and theta), matching the other DataSketches implementations.

Related

Testing

  • cargo x prepare-testdata
  • cargo x check
  • cargo x test
  • cargo x lint

Comment thread datasketches/src/thetafamily/common/jaccard_similarity.rs
@ariesdevil

Copy link
Copy Markdown
Contributor

rest LGTM

@ariesdevil ariesdevil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread datasketches/src/thetafamily/common/jaccard_similarity.rs
@tisonkun
tisonkun enabled auto-merge (squash) August 5, 2026 07:11
@tisonkun
tisonkun merged commit dc26037 into apache:main Aug 5, 2026
10 checks passed
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.

3 participants