DS_THETA_COUNT_DISTINCT (Lakehouse v2)
Returns an approximate distinct count using DataSketches Theta algorithm. Supports set operations like intersection and difference.
Analyze Syntax
Section titled “Analyze Syntax”func.ds_theta_count_distinct(get_column(table, 'user_id'))Analyze Examples
Section titled “Analyze Examples”func.ds_theta_count_distinct(get_column(table, 'user_id'))
┌───────┐│ 10035 │└───────┘SQL Syntax
Section titled “SQL Syntax”DS_THETA_COUNT_DISTINCT(<expr>)SQL Examples
Section titled “SQL Examples”SELECT DS_THETA_COUNT_DISTINCT(user_id) FROM page_views;
┌───────┐│ 10035 │└───────┘