用途
view: view_name {
measure: field_name {
approximate_threshold: 100000
}
}
|
階層
approximate_threshold |
使用可能なフィールドタイプ
測定
許可
整数
|
定義
Google BigQuery レガシー SQL は、個別の値が 1,000 個未満の場合は正確な count_distinct を計算しますが、個別の値の数が大きい場合は近似値を計算します。概算カウントは高速ですが、通常は数パーセントの誤差があります。
BigQuery レガシー SQL で 1,000 個を超える個別の値に対して正確な count_distinct を計算する場合は、approximate_threshold パラメータを使用してその量を設定できます。
例
最大 100,000 個の一意の値に対して正確な count_distinct を返します。
measure: unique_count {
type: count_distinct
approximate_threshold: 100000 # default value is 1000
sql: ${id} ;;
}