Skip to content

Instantly share code, notes, and snippets.

SELECT
CAST(hist.x as int) as bin_center,
CAST(hist.y as bigint) as bin_height
FROM (select
histogram_numeric(salary, 20) as salary_hist
from
sample_08) a
LATERAL VIEW explode(salary_hist) exploded_table as hist;
--Results