SUM overflows
When using SUM() on a large table (1 billion rows), it overflows without warning me: dbadmin=> select SUM(sales) from schema.fact_table; SUM ----------------------- -8083921422909.855574 (1 row) dbadmin=> select SUM(CAST(sales as NUMERIC(30,8))) from schema.fact_table; SUM ------------------------- 10362822650799.69604200 (1 row) dbadmin=> The documentation says SUM should throw an error if that happens. Is this a bug? Or am I missing something?
0
Comments