跳转到内容

返回出现频率最高的前 k 个值及其近似计数。

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}] │
└───────────────────────────────────┘