メインコンテンツまでスキップ
メインコンテンツまでスキップ

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)