メインコンテンツへスキップ
メインコンテンツへスキップ

aggThrow

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

構文

aggThrow(throw_prob)

引数

  • throw_prob — 作成時に例外をスローする確率。Float64

戻り値

  • 例外: Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully

クエリ:

SELECT number % 2 AS even, aggThrow(number) FROM numbers(10) GROUP BY even;

結果:

Received exception:
Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully: While executing AggregatingTransform. (AGGREGATE_FUNCTION_THROW)