Impala Doesn't Have a `histogram()` function

Impala Doesn’t Have a histogram() function.

Ibis’s histogram works by normalizing a column and rounding to integers:

WITH t0 AS
  ( SELECT *
   FROM db.`table_name`)
SELECT floor((t0.`column_name` - (t1.`min_1fe5be` - 1e-13)) / ((t1.`max_1fe5be` - (t1.`min_1fe5be` - 1e-13)) / (NUM_BINS - 1))) AS `tmp`
FROM t0
CROSS JOIN
  ( SELECT min(`column_name`) AS `min_1fe5be`,
           max(`column_name`) AS `max_1fe5be`
   FROM t0 ) t1
Back