Skip to main content
Combines multiple serialized HyperLogLog sketches into a single serialized sketch. This function is part of the DataSketches HLL family of functions for approximate distinct counting. ds_hll_combine takes multiple VARBINARY serialized sketches created by ds_hll_accumulate and merges them into a single sketch that represents the union of all distinct values. It is based on Apache DataSketches and provides high precision for approximate distinct counting. For more information, see HyperLogLog Sketches.

Syntax

Parameters

  • sketch: A VARBINARY column containing serialized HyperLogLog sketches created by ds_hll_accumulate.

Return Type

Returns a VARBINARY containing the combined serialized HyperLogLog sketch.

Examples

  • ds_hll_accumulate: Creates serialized HyperLogLog sketches from data
  • ds_hll_estimate: Estimates the distinct count from a serialized sketch
  • ds_hll_count_distinct: Direct approximate distinct counting function

Keywords

ds_HLL_COMBINE, HLL, HYPERLOGLOG, APPROXIMATE, DISTINCT, COUNT, MERGE, UNION