count_min_sketch

count_min_sketch

count_min_sketch介绍

count_min_sketch(col, eps, confidence, seed) - 返回给定列的计数-最小草图,使用指定的误差界限(eps)、置信度(confidence)和种子(seed)。结果是一个字节数组,可以在使用前反序列化为 CountMinSketch。计数-最小草图是一种概率性数据结构,用于在子线性空间内进行基数估计。

Examples:

> SELECT hex(count_min_sketch(col, 0.5d, 0.5d, 1)) FROM VALUES (1), (2), (1) AS tab(col);
 0000000100000000000000030000000100000004000000005D8D6AB90000000000000000000000000000000200000000000000010000000000000000

Since: 2.2.0