VeloDB Cloud
SQL Reference
SQL Functions
Aggregate Functions
BITMAP-UNION-INT

BITMAP-UNION-INT

Description

Counts the number of distinct values in columns of type TINYINT, SMALLINT and INT. The return value is the same as COUNT(DISTINCT expr)

Syntax

BITMAP_UNION_INT(<expr>)

Parameters

ParameterDescription
<expr>Supports columns or column expressions of type TINYINT, SMALLINT and INT

Return Value

Returns the number of distinct values in a column.

Example

select dt,page,bitmap_to_string(user_id) from pv_bitmap;
+------+------+---------------------------+
| dt   | page | bitmap_to_string(user_id) |
+------+------+---------------------------+
|    1 | 100  | 100,200,300               |
|    1 | 300  | 300                       |
|    2 | 200  | 300                       |
+------+------+---------------------------+
select bitmap_union_int(dt) from pv_bitmap;
+----------------------+
| bitmap_union_int(dt) |
+----------------------+
|                    2 |
+----------------------+