> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# bitmap_union

> 计算一组 Bitmap 值的并集。

输入一组 bitmap 值，求这一组 bitmap 值的并集。

## 语法

```Haskell theme={null}
BITMAP_UNION(value)
```

## 参数说明

`value`: 支持的数据类型为 BITMAP。

## 返回值说明

返回值的数据类型为 BITMAP。

## 示例

```sql theme={null}
select page_id, bitmap_union(user_id)
from table
group by page_id;
```

和 bitmap\_count 函数组合使用可以求得网页的 UV 数据。

```sql theme={null}
select page_id, bitmap_count(bitmap_union(user_id))
from table
group by page_id;
```

当 `user_id` 字段为 INT 时，上面查询语义等同于如下语句：

```sql theme={null}
select page_id, count(distinct user_id)
from table
group by page_id;
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.