Computes the union of input Bitmaps and returns their cardinality.
BITMAP_UNION_COUNT(<expr>)
| Parameter | Description |
|---|---|
<expr> | Supported data types of BITMAP |
Returns the size of the Bitmap union, that is, the number of elements after deduplication
select dt,page,bitmap_to_string(user_id) from pv_bitmap;
+------+------+---------------------------+ | dt | page | bitmap_to_string(user_id) | +------+------+---------------------------+ | 1 | 100 | 100,200,300 | | 2 | 200 | 300 | +------+------+---------------------------+
Calculate the deduplication value of user_id:
select bitmap_union_count(user_id) from pv_bitmap;
+-------------------------------------+ | bitmap_count(bitmap_union(user_id)) | +-------------------------------------+ | 3 | +-------------------------------------+