mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
Merge pull request #66164 from Blargian/docs_aggThrow
[Docs] add `aggThrow` function
This commit is contained in:
commit
4eeb59ec3f
@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
slug: /en/sql-reference/aggregate-functions/reference/aggthrow
|
||||||
|
sidebar_position: 101
|
||||||
|
---
|
||||||
|
|
||||||
|
# aggThrow
|
||||||
|
|
||||||
|
This function can be used for the purpose of testing exception safety. It will throw an exception on creation with the specified probability.
|
||||||
|
|
||||||
|
**Syntax**
|
||||||
|
|
||||||
|
```sql
|
||||||
|
aggThrow(throw_prob)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Arguments**
|
||||||
|
|
||||||
|
- `throw_prob` — Probability to throw on creation. [Float64](../../data-types/float.md).
|
||||||
|
|
||||||
|
**Returned value**
|
||||||
|
|
||||||
|
- An exception: `Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully`.
|
||||||
|
|
||||||
|
**Example**
|
||||||
|
|
||||||
|
Query:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
SELECT number % 2 AS even, aggThrow(number) FROM numbers(10) GROUP BY even;
|
||||||
|
```
|
||||||
|
|
||||||
|
Result:
|
||||||
|
|
||||||
|
```response
|
||||||
|
Received exception:
|
||||||
|
Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully: While executing AggregatingTransform. (AGGREGATE_FUNCTION_THROW)
|
||||||
|
```
|
@ -43,6 +43,7 @@ Standard aggregate functions:
|
|||||||
|
|
||||||
ClickHouse-specific aggregate functions:
|
ClickHouse-specific aggregate functions:
|
||||||
|
|
||||||
|
- [aggThrow](../reference/aggthrow.md)
|
||||||
- [analysisOfVariance](../reference/analysis_of_variance.md)
|
- [analysisOfVariance](../reference/analysis_of_variance.md)
|
||||||
- [any](../reference/any_respect_nulls.md)
|
- [any](../reference/any_respect_nulls.md)
|
||||||
- [anyHeavy](../reference/anyheavy.md)
|
- [anyHeavy](../reference/anyheavy.md)
|
||||||
|
@ -1098,6 +1098,8 @@ aggregatefunction
|
|||||||
aggregatingmergetree
|
aggregatingmergetree
|
||||||
aggregatio
|
aggregatio
|
||||||
aggretate
|
aggretate
|
||||||
|
aggthrow
|
||||||
|
aggThrow
|
||||||
aiochclient
|
aiochclient
|
||||||
allocator
|
allocator
|
||||||
alphaTokens
|
alphaTokens
|
||||||
|
Loading…
Reference in New Issue
Block a user