Skip to content

Conversation

@Fengzdadi
Copy link
Contributor

Summary

Add example test files for 4 sketch types that were previously missing examples:

  • Theta Sketch
  • Bloom Filter
  • Count-Min Sketch
  • Tuple Sketch

Motivation

The examples/ directory had examples for some sketches (CPC, HLL, KLL, Frequency) but was missing examples for Theta, Bloom Filter, Count-Min, and Tuple Sketches. These examples help new users understand how to use these sketches.

Changes

File Description
examples/theta_example_test.go Demonstrates basic ops, Union, Intersection, A-not-B, serialization
examples/bloom_filter_example_test.go Demonstrates membership testing, Union, serialization
examples/count_min_example_test.go Demonstrates frequency estimation, merging, serialization
examples/tuple_example_test.go Demonstrates custom Summary type, aggregation, Union/Intersection with Policy

Testing

All tests pass:

go test -v ./examples/

Checklist

  • All example tests pass
  • Follows existing code style (Apache license header, testify assertions)
  • Each example demonstrates key features of its respective sketch

Copy link
Member

@freakyzoidberg freakyzoidberg left a comment

Choose a reason for hiding this comment

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

Thank you !

@freakyzoidberg freakyzoidberg merged commit 0e5a70e into apache:main Jan 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants