Polars Estimates Cardinality With HyperLogLog
The HyperLogLog register trick turns a 64-bit hash into an index and a rank, and Polars’ estimator replaces the classic bias correction with Ertl’s tau/sigma correction; a second, …
The HyperLogLog register trick turns a 64-bit hash into an index and a rank, and Polars’ estimator replaces the classic bias correction with Ertl’s tau/sigma correction; a second, …
The row encoder writes each key column into a self-describing byte layout: a sentinel for null, big-endian bytes with the sign bit flipped for numbers, a terminator for strings. …
The eager group-by checks the column’s IsSorted flag before it builds anything. If the keys are sorted, the groups are contiguous row ranges, produced by a run-length scan that can …
Grouping in Polars is a separate stage: keys are encoded (single key, key rows, row encoding, or binview), hashed into group ids by a Grouper, and every aggregation expression then …
Rows are partitioned by hash(key) into N buckets, so equal keys always land in the same bucket. Each bucket is aggregated or joined independently, which is a shuffle instead of a …