Skip to content

Returns the top-k most frequent values and their approximate counts.

func.approx_top_k(get_column(table, 'city'), 3)
func.approx_top_k(get_column(table, 'city'), 3)
┌──────────────────────────────┐
[{"item":"NYC","count":150}]
└──────────────────────────────┘
APPROX_TOP_K(<city>, 3)
SELECT APPROX_TOP_K(city, 3) FROM customers;
┌───────────────────────────────────┐
│ [{"item":"New York","count":150}] │
└───────────────────────────────────┘