You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And, a follow up: If the input at compile-time was dynamic, what is the output value's type of all of the above (excluding the last case)?
For now, from a discussion with @jpschorr, we've decided that for the exact numeric types, since AVG = SUM / COUNT and COUNT returns a BIGINT (which has a precision of 19), then for the integral types, the output of average will be DECIMAL(38, 19). We need to think about this more and formalize this.
DoD
This needs to be clarified and implemented.
The text was updated successfully, but these errors were encountered:
Description
What is the output static type of:
AVG(tinyint)
AVG(smallint)
AVG(int)
AVG(bigint)
AVG(numeric(p, s))
AVG(decimal(p, s))
AVG(real)
AVG(double precision)
AVG(dynamic)
And, a follow up: If the input at compile-time was dynamic, what is the output value's type of all of the above (excluding the last case)?
For now, from a discussion with @jpschorr, we've decided that for the exact numeric types, since
AVG = SUM / COUNT
andCOUNT
returns aBIGINT
(which has a precision of 19), then for the integral types, the output of average will beDECIMAL(38, 19)
. We need to think about this more and formalize this.DoD
The text was updated successfully, but these errors were encountered: