EQUIWIDTH_BUCKET (Lakehouse v2)
Renvoie le numéro de tranche d’une valeur dans un histogramme à largeur égale. Divise la plage [min, max] en intervalles de largeur égale.
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.equiwidth_bucket(<expr>, <min>, <max>, <num_buckets>)Exemples Analyze
Section intitulée « Exemples Analyze »func.equiwidth_bucket(75, 0, 100, 10)
┌───┐│ 8 │└───┘Syntaxe SQL
Section intitulée « Syntaxe SQL »EQUIWIDTH_BUCKET(<expr>, <min>, <max>, <num_buckets>)Exemples SQL
Section intitulée « Exemples SQL »SELECT score, EQUIWIDTH_BUCKET(score, 0, 100, 10) AS bucketFROM students;
┌───────┬────────┐│ score │ bucket │├───────┼────────┤│ 25 │ 3 ││ 75 │ 8 ││ 95 │ 10 │└───────┴────────┘