diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMovingSum.h b/dbms/src/AggregateFunctions/AggregateFunctionMovingSum.h index df97a476e48..944f3c2a178 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMovingSum.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMovingSum.h @@ -112,6 +112,8 @@ public: value.resize(size, arena); buf.read(reinterpret_cast(value.data()), size * sizeof(value[0])); + + this->data(place).sum = value.back(); } void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override