DS_THETA_COUNT_DISTINCT (Lakehouse v2)
使用 DataSketches Theta 算法返回近似去重计数。支持交集和差集等集合运算。
Analyze 语法
Section titled “Analyze 语法”func.ds_theta_count_distinct(get_column(table, 'user_id'))Analyze 示例
Section titled “Analyze 示例”func.ds_theta_count_distinct(get_column(table, 'user_id'))
┌───────┐│ 10035 │└───────┘SQL 语法
Section titled “SQL 语法”DS_THETA_COUNT_DISTINCT(<expr>)SQL 示例
Section titled “SQL 示例”SELECT DS_THETA_COUNT_DISTINCT(user_id) FROM page_views;
┌───────┐│ 10035 │└───────┘