uniqTheta
引入版本:v21.6.0
使用 Theta Sketch Framework 近似计算不同参数值的数量。
实现细节
语法
uniqTheta(x[, ...])参数
返回值
返回一个 UInt64 类型的数值,表示不同参数值的近似个数。UInt64
示例
基本用法
CREATE TABLE example_theta
(
id UInt32,
category String
)
ENGINE = Memory;
INSERT INTO example_theta VALUES
(1, 'A'), (2, 'B'), (3, 'A'), (4, 'C'), (5, 'B'), (6, 'A');
SELECT uniqTheta(category) as theta_unique_categories
FROM example_theta;┌─theta_unique_categories─┐
│ 3 │
└─────────────────────────┘另请参阅