Decimal multiplication precision rule — is p1+p2+1 intentional in Starburst Enterprise?

Hi,

We are working on an ODBC driver that connects to Starburst Enterprise and noticed an unexpected behavior in decimal multiplication type inference.

Observation:

On Starburst Enterprise 477-e and 480-e, multiplying two decimal columns returns precision p1+p2+1 instead of the documented min(38, p1+p2) while Galaxy returns p1+p2. Release notes say:

“Arithmetic operations on decimal values now use improved type inference rules”

But the exact new formula is not documented.

Is this p1+p2+1 on enterprise correct? I tested on Enterprise 480-e and Galaxy 480.

Thank you

Have you seen Trino | Introducing the NUMBER data type ? I think it is related to what you are describing

Found out from the committer this was a change from a few weeks ago as you can see the details of in Tighten decimal multiplication result precision by findepi · Pull Request #29383 · trinodb/trino · GitHub.