APPROX_COUNT_DISTINCT (Lakehouse v2)
Returns an approximate count of distinct values using HyperLogLog.
Analyze Syntax
Section titled “Analyze Syntax”func.approx_count_distinct(get_column(table, 'user_id'))Analyze Examples
Section titled “Analyze Examples”func.approx_count_distinct(get_column(table, 'user_id'))
┌─────┐│ 985 │└─────┘SQL Syntax
Section titled “SQL Syntax”APPROX_COUNT_DISTINCT(<user_id>)SQL Examples
Section titled “SQL Examples”SELECT APPROX_COUNT_DISTINCT(user_id) FROM page_views;
┌─────┐│ 985 │└─────┘