コンテンツにスキップ

DataSketches HLLアルゴリズムを使用して、異なる値のおおよその件数を返します。APPROX_COUNT_DISTINCT より高精度です。

func.ds_hll_count_distinct(get_column(table, 'user_id'))
func.ds_hll_count_distinct(get_column(table, 'user_id'))
┌───────┐
│ 10042 │
└───────┘
DS_HLL_COUNT_DISTINCT(<expr>)
SELECT DS_HLL_COUNT_DISTINCT(user_id) FROM page_views;
┌───────┐
│ 10042 │
└───────┘