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

> Calcula o OR de uma coluna de bitmap e retorna a cardinalidade do tipo UInt64; se o sufixo -State for adicionado, retorna um objeto bitmap. Isso é equivalente a `groupBitmapMerge`.

# groupBitmapOr

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

Introduzido em: v20.1.0

Calcula o OR de uma coluna de bitmap e retorna sua cardinalidade.
Se o sufixo combinador [`-State`](/pt-BR/reference/functions/aggregate-functions/combinators#-state) for adicionado, retornará um objeto bitmap.
Isso equivale a `groupBitmapMerge` ([`groupBitmap`](/pt-BR/reference/functions/aggregate-functions/groupBitmap) com o sufixo combinador [`-Merge`](/pt-BR/reference/functions/aggregate-functions/combinators#-merge)).

**Sintaxe**

```sql theme={null}
groupBitmapOr(expr)
groupBitmapOrState(expr)
```

**Argumentos**

* `expr` — Expressão que resulta em um valor do tipo `AggregateFunction(groupBitmap, UInt*)`. [`AggregateFunction(groupBitmap, UInt*)`](/pt-BR/reference/data-types/aggregatefunction)

**Valor retornado**

Retorna uma contagem do tipo `UInt64` ou um objeto bitmap ao usar `-State`. [`UInt64`](/pt-BR/reference/data-types/int-uint)

**Exemplos**

**Exemplo de uso**

```sql title=Query theme={null}
CREATE TABLE bitmap_column_expr_test2
(
    tag_id String,
    z AggregateFunction(groupBitmap, UInt32)
)
ENGINE = MergeTree
ORDER BY tag_id;

INSERT INTO bitmap_column_expr_test2 VALUES ('tag1', bitmapBuild(cast([1,2,3,4,5,6,7,8,9,10] AS Array(UInt32))));
INSERT INTO bitmap_column_expr_test2 VALUES ('tag2', bitmapBuild(cast([6,7,8,9,10,11,12,13,14,15] AS Array(UInt32))));
INSERT INTO bitmap_column_expr_test2 VALUES ('tag3', bitmapBuild(cast([2,4,6,8,10,12] AS Array(UInt32))));

SELECT groupBitmapOr(z) FROM bitmap_column_expr_test2 WHERE like(tag_id, 'tag%');
```

```response title=Response theme={null}
┌─groupBitmapOr(z)─┐
│             15   │
└──────────────────┘
```

**Usando o combinador -State**

```sql title=Query theme={null}
SELECT arraySort(bitmapToArray(groupBitmapOrState(z))) FROM bitmap_column_expr_test2 WHERE like(tag_id, 'tag%');
```

```response title=Response theme={null}
┌─arraySort(bitmapToArray(groupBitmapOrState(z)))─┐
│ [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]           │
└─────────────────────────────────────────────────┘
```
