code: func (af *avgFunction) Update(row []types.Datum, groupKey []byte, ctx context.Context) error {
  	if af.mode == FinalMode {
  		return af.updateAvg(row, groupKey, ctx)
  	}
  	return af.updateSum(row, groupKey, ctx)
  }
docs: // Update implements AggregationFunction interface.