> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 부호 없는 정수 컬럼에 대해 비트맵 또는 집계 계산을 수행하고, UInt64 유형의 카디널리티를 반환하며, 접미사 -State를 추가하면 비트맵 객체를 반환합니다

# groupBitmap

<div id="groupBitmap">
  ## groupBitmap
</div>

도입 버전: v20.1.0

부호 없는 정수 컬럼에서 비트맵(비트 배열)을 생성한 다음, 해당 비트맵의 고유한 값 개수(카디널리티)를 반환합니다.
개수를 반환하는 대신 `-State` combinator 접미사를 추가하면 실제 [비트맵 객체](/ko/reference/functions/regular-functions/bitmap-functions)를 반환합니다.

**구문**

```sql theme={null}
groupBitmap(expr)
groupBitmapState(expr)
```

**인수**

* `expr` — `UInt*` 타입 결과를 반환하는 표현식입니다. [`UInt*`](/ko/reference/data-types/int-uint)

**반환 값**

`UInt64` 타입의 값을 반환하며, `-State`를 사용할 때는 비트맵 객체를 반환합니다. [`UInt64`](/ko/reference/data-types/int-uint)

**예시**

**사용 예시**

```sql title=Query theme={null}
CREATE TABLE t (UserID UInt32) ENGINE = Memory;
INSERT INTO t VALUES (1), (1), (2), (3);

SELECT groupBitmap(UserID) AS num FROM t;
```

```response title=Response theme={null}
┌─num─┐
│   3 │
└─────┘
```
