Describe the bug
The return type for avg(decimal) is currently Decimal(p + 4, s + 4), saturating at the width's max size.
For columns that have a precision that is close to the variant's maximum precision, the output might not fit into the return type, resulting in an overflow.
To Reproduce
No response
Expected behavior
Averages shouldn't overflow at that last step, especially as this is a predictable output.
Additional context
No response
Describe the bug
The return type for
avg(decimal)is currentlyDecimal(p + 4, s + 4), saturating at the width's max size.For columns that have a precision that is close to the variant's maximum precision, the output might not fit into the return type, resulting in an overflow.
To Reproduce
No response
Expected behavior
Averages shouldn't overflow at that last step, especially as this is a predictable output.
Additional context
No response