def __init__(self, base_qs, grouping_fields, calculated_fields):
super(AggregateQuerySet, self).__init__(base_qs._model_cls, base_qs._database)<EOL>assert calculated_fields, '<STR_LIT>'<EOL>self._fields = grouping_fields<EOL>self._grouping_fields = grouping_fields<EOL>self._calculated_fields = calculated_fields<EOL>self._order_by = list(base_qs._order_by)<EOL>self._where_q = base_qs._where_q<EOL>self._prewhere_q = base_qs._prewhere_q<EOL>self._limits = base_qs._limits<EOL>self._distinct = base_qs._distinct<EOL>
Initializer. Normally you should not call this but rather use `QuerySet.aggregate()`.

The grouping fields should be a list/tuple of field names from the model. For example:
```
    ('event_type', 'event_subtype')
```
The calculated fields should be a mapping from name to a ClickHouse aggregation function. For example:
```
    {'weekday': 'toDayOfWeek(event_date)', 'number_of_events': 'count()'}
```
At least one calculated field is required.