Add the built-in function
WIDTH_BUCKET (expr, min_value, max_value, num_buckets)
<width bucket function> is a function of four arguments, returning an integer between 0 (zero) and the value of the final argument plus 1 (one), by assigning the first argument to an equi-width partitioning of the range of numbers between the second and third arguments. Values outside the range between the second and third arguments are assigned to either 0 (zero) or the value of the final argument plus 1 (one).
|Impala Doc: WIDTH_BUCKET function||Closed|