approximate_threshold

使用状況

ビュー: 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} ;;
}