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

> この関数は、例外安全性 をテストするために使用できます。 指定した確率で、作成時に例外をスローします。

# aggThrow

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

導入バージョン: v20.1.0

この関数は、例外安全性のテストに使用できます。指定した確率で、作成時に例外をスローします。

**構文**

```sql theme={null}
aggThrow(throw_prob)
```

**引数**

* `throw_prob` — 作成時に例外をスローする確率。[`Float64`](/ja/reference/data-types/float)

**戻り値**

次の例外を返します: `Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully`.

**例**

**使用例**

```sql title=Query theme={null}
SELECT number % 2 AS even, aggThrow(number) FROM numbers(10) GROUP BY even;
```

```response title=Response theme={null}
Received exception:
Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully: While executing AggregatingTransform. (AGGREGATE_FUNCTION_THROW)
```
