EQUIWIDTH_BUCKET(Lakehouse v2)
等幅ヒストグラムにおける値のバケット番号を返します。範囲 [min, max] を等幅の区間に分割します。
Analyze 構文
Section titled “Analyze 構文”func.equiwidth_bucket(<expr>, <min>, <max>, <num_buckets>)Analyze の例
Section titled “Analyze の例”func.equiwidth_bucket(75, 0, 100, 10)
┌───┐│ 8 │└───┘SQL 構文
Section titled “SQL 構文”EQUIWIDTH_BUCKET(<expr>, <min>, <max>, <num_buckets>)SQL の例
Section titled “SQL の例”SELECT score, EQUIWIDTH_BUCKET(score, 0, 100, 10) AS bucketFROM students;
┌───────┬────────┐│ score │ bucket │├───────┼────────┤│ 25 │ 3 ││ 75 │ 8 ││ 95 │ 10 │└───────┴────────┘