mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-07 17:10:49 +00:00
c1b71ab06e
* CLICKHOUSEDOCS-733: Fixed some broken links. Updated introduction and TOC in aggregate functions. * CLICKHOUSEDOCS-733: Fixed files endings. * CLICKHOUSEDOCS-733: Returned the list of functions back to reference index. Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru> Co-authored-by: emironyuk <em@don.ru>
47 lines
998 B
Markdown
47 lines
998 B
Markdown
---
|
||
toc_priority: 128
|
||
---
|
||
|
||
# groupBitmap {#groupbitmap}
|
||
|
||
Bitmap или агрегатные вычисления для столбца с типом данных `UInt*`, возвращают кардинальность в виде значения типа UInt64, если добавить суффикс -State, то возвращают [объект bitmap](../../../sql-reference/functions/bitmap-functions.md).
|
||
|
||
``` sql
|
||
groupBitmap(expr)
|
||
```
|
||
|
||
**Параметры**
|
||
|
||
`expr` – выражение, результат которого имеет тип данных `UInt*`.
|
||
|
||
**Возвращаемое значение**
|
||
|
||
Значение типа `UInt64`.
|
||
|
||
**Пример**
|
||
|
||
Тестовые данные:
|
||
|
||
``` text
|
||
UserID
|
||
1
|
||
1
|
||
2
|
||
3
|
||
```
|
||
|
||
Запрос:
|
||
|
||
``` sql
|
||
SELECT groupBitmap(UserID) as num FROM t
|
||
```
|
||
|
||
Результат:
|
||
|
||
``` text
|
||
num
|
||
3
|
||
```
|
||
|
||
[Оригинальная статья](https://clickhouse.tech/docs/en/sql-reference/aggregate-functions/reference/groupbitmap/) <!--hide-->
|