DS_HLL_COUNT_DISTINCT (Lakehouse v2)
Returns an approximate distinct count using DataSketches HLL algorithm. More accurate than APPROX_COUNT_DISTINCT.
Analyze Syntax
Section titled “Analyze Syntax”func.ds_hll_count_distinct(get_column(table, 'user_id'))Analyze Examples
Section titled “Analyze Examples”func.ds_hll_count_distinct(get_column(table, 'user_id'))
┌───────┐│ 10042 │└───────┘SQL Syntax
Section titled “SQL Syntax”DS_HLL_COUNT_DISTINCT(<expr>)SQL Examples
Section titled “SQL Examples”SELECT DS_HLL_COUNT_DISTINCT(user_id) FROM page_views;
┌───────┐│ 10042 │└───────┘