Skip to content

approx_distinct: make HLL register precision configurable #23815

Description

@sandeshkr419

Is your feature request related to a problem or challenge?

approx_distinct / HyperLogLog hardcodes precision at p=14 (16384 registers, 16 KiB per sketch). There is currently no way for callers to trade accuracy for lower memory or smaller partial-aggregate state on the wire.

Describe the solution you'd like

Request is to add HyperLogLog::with_precision(p) and ApproxDistinct::with_hll_precision(p) so that integrators can request a smaller sketch (e.g. p=12 → 4 KiB, ~1.6% error) without changing the default behaviour.

Note: This does not affects non-approx paths which use bitmap for exact distinct count.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions