Open Fedomn opened 2 years ago
We can follow the Postgres convention. IIRC, it will use i64 to sum i32 and use Decimal to sum i64.
I think we can start working on it when we have a fully functional expression framework. Currently, it's hard to write such aggregation in our system.
Just link Postgres convention docs https://www.postgresql.org/docs/current/functions-aggregate.html
It used numeric
for sum(bigint)
and avg(bigint)
, and numeric seems similar with decimal
Currently, our sum aggregation used the primitive datatype
add
function to calculate results. So sometimes the calculation will cause overflow panic.Maybe we need to use the
Decimal
orFloat64
type for thesum
calculation.Minimal reproduce step
What did you expect to see?