List<SingleAggregateFunction> aggFuncs = new ArrayList<SingleAggregateFunction>(aggFuncSet);
Collections.sort(aggFuncs, SingleAggregateFunction.SCHEMA_COMPARATOR);
int minNullableIndex = getMinNullableIndex(aggFuncs,groupBy.isEmpty());
context.getScan().setAttribute(GroupedAggregateRegionObserver.AGGREGATORS, ServerAggregators.serialize(aggFuncs, minNullableIndex));
ClientAggregators clientAggregators = new ClientAggregators(aggFuncs, minNullableIndex);
context.getAggregationManager().setAggregators(clientAggregators);
}