}
// Analyze rollup
GroupByRollupInfo groupByInfo = analyzeValidateGroupBy(statementSpec.getGroupByExpressions(), validationContext);
ExprNode[] groupByNodesValidated = groupByInfo == null ? new ExprNode[0] : groupByInfo.getExprNodes();
AggregationGroupByRollupDesc groupByRollupDesc = groupByInfo == null ? null : groupByInfo.getRollupDesc();
// Construct the appropriate aggregation service
boolean hasGroupBy = groupByNodesValidated.length > 0;
AggregationServiceFactoryDesc aggregationServiceFactory = AggregationServiceFactoryFactory.getService(
selectAggregateExprNodes, groupByNodesValidated, havingAggregateExprNodes, orderByAggregateExprNodes, Collections.<ExprAggregateNodeGroupKey>emptyList(), hasGroupBy, evaluatorContextStmt, statementSpec.getAnnotations(), stmtContext.getVariableService(), typeService.getEventTypes().length > 1, false,