Overflow handling of decimals
An ArrayIndexOutOfBoundsException is returned when a sum operation on a decimal column overflows beyond the maximum precision.
Before upgrade to CDP
When a column is defined as decimal and a sum operation on that column overflows beyond the
maximum decimal precision (38), the an exception
occurs:
create table decimal_precision(dec decimal(38,18));
insert into decimal_precision values(98765432109876543210.12345), (98765432109876543210.12345);
select sum(dec) from decimal_precision;
This query fails with an
ArrayIndexOutOfBoundsException.After upgrade to CDP
HIVE-13423 handles this issue by displaying a warning message and returning NULL when the result of a SUM operation on a decimal column goes beyond the decimal precision range.