Precision and scale changes

Learn about the change in behavior of precision and scale in arithmetic operations.

Before Upgrade to CDP 7.1.6

In CDP Private Cloud Base 7.1.5 and lower versions, the default maximum precision and scale for arithmetic operations was calculated differently. For example, the following expression returns a result of 15237461344547437170.339101086652 with decimal(34, 12):
select cast( '12346789101112123.12345678' as decimal(25,8)) * cast('1234.1234' as decimal(25,8))

After Upgrade to CDP 7.1.6

In CDP Private Cloud Base 7.1.6 and higher versions, the default maximum precision and scale for arithmetic operations follow the specifications defined in Microsoft SQL Server documentation.

As a result, the above expression returns a result of 15237461344547437170.339101 with decimal(38, 6).

For more information, see HIVE-24389, HIVE-25263, and HIVE-15331.