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,
statementSpec.getFilterRootNode(), statementSpec.getHavingExprRootNode(),
stmtContext.getAggregationServiceFactoryService(), typeService.getEventTypes(), stmtContext.getMethodResolutionService(), groupByRollupDesc,
statementSpec.getOptionalContextName());