What is the `hll` data type?
masterThe hll data type is a HyperLogLog implementation used for efficient, fixed-size, set-like distinct value counting. It allows estimating the cardinality of massive datasets (e.g., tens of billions of values) with a small memory footprint (e.g., 1280 bytes) and tunable precision.
It uses a promotion hierarchy to balance accuracy and performance:
EMPTY: A constant representing an empty set.EXPLICIT: A sorted list of unique integers for exact counting at low cardinalities.SPARSE: A map-based probabilistic structure that only stores non-zero registers.FULL: A fully-materialized, bit-packed list of all registers.
As the number of distinct values grows, the structure automatically promotes from EMPTY $\rightarrow$ EXPLICIT $\rightarrow$ SPARSE $\rightarrow$ FULL.