数据仓库服务 GAUSSDB(DWS)-Roaring Bitmap聚合函数:rb_or_cardinality_agg(roaringbitmap)

时间:2024-12-24 10:32:43

rb_or_cardinality_agg(roaringbitmap)

描述:将分组内的roaringbitmap按照并集计算后的基数。

示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SELECT a, rb_or_cardinality_agg(b) FROM r1 GROUP BY a ORDER BY 1;
 a  | rb_or_cardinality_agg
----+-----------------------
 1  |                     1
 2  |                     2
 3  |                     2
 4  |                     2
 5  |                     2
 6  |                     2
 7  |                     2
 8  |                     2
 9  |                     2
 10 |                     2
(10 rows)
support.huaweicloud.com/sqlreference-dws/dws_06_0324.html