Changelog
Source:NEWS.md
data.sketches 0.1.1
CRAN release: 2026-09-23
Bug fixes
Interrupting a long
$update()or query no longer leaks its input vector. The native loops probed for interrupts withR_CheckUserInterrupt(), which longjmps past C++ destructors and so skipped the release of cpp11’s preserve token on the input; an interrupted 40M-element update pinned ~320 MB in R’s precious list for the rest of the session. All 25 probe sites now usecpp11::check_user_interrupt(), which unwinds throughR_UnwindProtect.theta()andarray_of_doubles()sketches rebuilt frombytes =no longer lose their width. A compact payload does not carry the builderlg_k, and the previous fallback to the default width silently cost about an order of magnitude of accuracy on any later$merge()or union — unioning two round-trippedlg_k = 20sketches retained 4,096 entries instead of 1,048,576. The width is now recovered from the retained-entry count.Native update and query loops no longer pump the R event loop on the first element of every call.
New features
-
$merge()ontheta_sketchandarray_of_doubles_sketchgains anlg_kargument, matchingtheta_union()andarray_of_doubles_union(). Previously there was no way to control the width of a merge.
Error handling
Errors originating in the C++ bridge now carry the same classed conditions as the R-level validators, so
tryCatch(datasketches_error = )catches every failure the package raises. New classes:datasketches_invalid_bytes(corrupt or truncatedbytes =payload),datasketches_empty_sketch($quantile(),$rank(),$cdf(),$pmf(),$min(),$max()on an empty sketch), anddatasketches_dead_pointer.Printing or summarising a sketch restored with
readRDS()orload()now raises an actionable error pointing at$serialize()/bytes =, rather than reporting that the object is not a valid sketch. External pointers do not survive R’s serialization; sketches must be persisted with$serialize().A
bytes =payload shorter than 8 bytes passed tohll()now raisesdatasketches_invalid_bytesrather thandatasketches_invalid_args, so a malformed payload has one class across all sketch families. Both classes inheritdatasketches_error.
data.sketches 0.1.0
CRAN release: 2026-07-09
- Initial release. Provides an R interface to the Apache DataSketches C++ library:
- Quantile sketches:
kll_doubles(),kll_floats(),req(), andtdigest_double(). - Cardinality sketches:
hll(),cpc(), andtheta()(with set operations). - Frequency sketches:
frequent_items()andcount_min(). - Tuple sketches:
array_of_doubles()(with set operations). - Sampling sketches:
varopt()andebpps(). - Filters:
bloom_filter().
$update(),$merge(),$summary(),$inspect(), and native$serialize()/bytes =round-tripping, plusformat(),print(),as.character(), andsummary()methods. - Quantile sketches: