> ## 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.

> uniqTheta 함수 문서

# uniqTheta 함수

uniqTheta 함수는 두 개의 uniqThetaSketch 객체에 대해 ∪ / ∩ / × (union/intersect/not)와 같은 집합 연산을 수행하여, 결과가 포함된 새로운 uniqThetaSketch 객체를 반환합니다.

uniqThetaSketch 객체는 집계 함수 uniqTheta에 -State를 붙여 생성할 수 있습니다.

UniqThetaSketch는 근사값 집합을 저장하는 데이터 구조입니다.
자세한 내용은 [Theta Sketch Framework](https://datasketches.apache.org/docs/Theta/ThetaSketches.html#theta-sketch-framework)를 참조하십시오.

<div id="uniqthetaunion">
  ## uniqThetaUnion
</div>

두 개의 uniqThetaSketch 객체에 대해 union 계산(집합 연산 ∪)을 수행하며, 결과로 새로운 uniqThetaSketch를 반환합니다.

```sql theme={null}
uniqThetaUnion(uniqThetaSketch,uniqThetaSketch)
```

**인수**

* `uniqThetaSketch` – `uniqThetaSketch` 객체입니다.

**예시**

```sql theme={null}
SELECT finalizeAggregation(uniqThetaUnion(a, b)) AS a_union_b, finalizeAggregation(a) AS a_cardinality, finalizeAggregation(b) AS b_cardinality
FROM
(SELECT arrayReduce('uniqThetaState',[1,2]) AS a, arrayReduce('uniqThetaState',[2,3,4]) AS b );
```

```text theme={null}
┌─a_union_b─┬─a_cardinality─┬─b_cardinality─┐
│         4 │             2 │             3 │
└───────────┴───────────────┴───────────────┘
```

<div id="uniqthetaintersect">
  ## uniqThetaIntersect
</div>

두 개의 uniqThetaSketch 객체에 대해 intersect 계산(집합 연산 ∩)을 수행하고, 그 결과로 새로운 uniqThetaSketch를 반환합니다.

```sql theme={null}
uniqThetaIntersect(uniqThetaSketch,uniqThetaSketch)
```

**인수**

* `uniqThetaSketch` – uniqThetaSketch 객체.

**예시**

```sql theme={null}
SELECT finalizeAggregation(uniqThetaIntersect(a, b)) AS a_intersect_b, finalizeAggregation(a) AS a_cardinality, finalizeAggregation(b) AS b_cardinality
FROM
(SELECT arrayReduce('uniqThetaState',[1,2]) AS a, arrayReduce('uniqThetaState',[2,3,4]) AS b );
```

```text theme={null}
┌─a_intersect_b─┬─a_cardinality─┬─b_cardinality─┐
│             1 │             2 │             3 │
└───────────────┴───────────────┴───────────────┘
```

<div id="uniqthetanot">
  ## uniqThetaNot
</div>

두 개의 uniqThetaSketch 객체에 대해 a\_not\_b 계산(집합 연산 ×)을 수행하며, 그 결과로 새로운 uniqThetaSketch를 반환합니다.

```sql theme={null}
uniqThetaNot(uniqThetaSketch,uniqThetaSketch)
```

**인수**

* `uniqThetaSketch` – uniqThetaSketch 객체.

**예시**

```sql theme={null}
SELECT finalizeAggregation(uniqThetaNot(a, b)) AS a_not_b, finalizeAggregation(a) AS a_cardinality, finalizeAggregation(b) AS b_cardinality
FROM
(SELECT arrayReduce('uniqThetaState',[2,3,4]) AS a, arrayReduce('uniqThetaState',[1,2]) AS b );
```

```text theme={null}
┌─a_not_b─┬─a_cardinality─┬─b_cardinality─┐
│       2 │             3 │             2 │
└─────────┴───────────────┴───────────────┘
```

**관련 항목**

* [uniqThetaSketch](/ko/reference/functions/aggregate-functions/uniqthetasketch)

{/*AUTOGENERATED_START*/}
