A small Clojure utility wrapper for some of the
Java stream-lib
library's HyperLogLog+ features.
Ref. https://github.com/addthis/stream-lib.
A small Clojure utility wrapper for some of the Java `stream-lib` library's HyperLogLog+ features. Ref. https://github.com/addthis/stream-lib.
(bytes->hll+ ba)
Returns HLL deserialized from given byte array.
Returns HLL deserialized from given byte array.
(card hll)
Returns (approximate) number of unique objects counted by the HLL.
Returns (approximate) number of unique objects counted by the HLL.
(hll+)
(hll+ precision)
(hll+ precision sparse-precision)
Returns a new stateful HyperLogLogPlus
instance with the given
precision parameters.
Approximate cardinality error and HLL size for given precision
:
Precision 4: error 21.0585% 0.02kb
Precision 5: error 16.0748% 0.032kb
Precision 6: error 11.8781% 0.052kb
Precision 7: error 8.0183% 0.096kb
Precision 8: error 5.7404% 0.181kb
Precision 9: error 4.3451% 0.353kb
Precision 10: error 3.7046% 0.693kb
Precision 11: error 2.8746% 1.377kb
Precision 12: error 1.908% 2.741kb ; Default
Precision 13: error 1.2265% 5.473kb
Precision 14: error 0.7323% 10.933kb
Precision 15: error 0.4851% 21.858kb
Precision 16: error 0.3483% 43.702kb
Precision 17: error 0.2217% 87.394kb
Precision 18: error 0.1594% 174.774kb
Precision 19: error 0.1016% 349.538kb
Returns a new stateful `HyperLogLogPlus` instance with the given precision parameters. Approximate cardinality error and HLL size for given `precision`: Precision 4: error 21.0585% 0.02kb Precision 5: error 16.0748% 0.032kb Precision 6: error 11.8781% 0.052kb Precision 7: error 8.0183% 0.096kb Precision 8: error 5.7404% 0.181kb Precision 9: error 4.3451% 0.353kb Precision 10: error 3.7046% 0.693kb Precision 11: error 2.8746% 1.377kb Precision 12: error 1.908% 2.741kb ; Default Precision 13: error 1.2265% 5.473kb Precision 14: error 0.7323% 10.933kb Precision 15: error 0.4851% 21.858kb Precision 16: error 0.3483% 43.702kb Precision 17: error 0.2217% 87.394kb Precision 18: error 0.1594% 174.774kb Precision 19: error 0.1016% 349.538kb
(hll+->bytes hll)
Returns given HLL serialized as a byte array.
Returns given HLL serialized as a byte array.
(insert! hll)
(insert! hll obj)
(insert! hll obj & more)
Like offer
but returns the given HLL.
Like `offer` but returns the given HLL.
(merge)
(merge hll)
(merge hll & more)
Returns a new HLL created by merging the given HLLs. None of the given HLLs are modified.
Returns a new HLL created by merging the given HLLs. None of the given HLLs are modified.
(offer! hll obj)
(offer! hll obj & more)
Modifies the given HLL to add the given object/s. Returns true iff the HLL's cardinality was affected.
Modifies the given HLL to add the given object/s. Returns true iff the HLL's cardinality was affected.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close