public static void assignSubqueryStrategies(SubSelectStrategyCollection subSelectStrategyCollection, Map<ExprSubselectNode, SubSelectStrategyHolder> subselectStrategyInstances) {
// initialize subselects expression nodes (strategy assignment)
for (Map.Entry<ExprSubselectNode, SubSelectStrategyHolder> subselectEntry : subselectStrategyInstances.entrySet()) {
ExprSubselectNode subselectNode = subselectEntry.getKey();
SubSelectStrategyHolder strategyInstance = subselectEntry.getValue();
subselectNode.setStrategy(strategyInstance.getStategy());
subselectNode.setSubselectAggregationService(strategyInstance.getSubselectAggregationService());
// initialize aggregations in the subselect
SubSelectStrategyFactoryDesc factoryDesc = subSelectStrategyCollection.getSubqueries().get(subselectNode);
if (factoryDesc.getAggregationServiceFactoryDesc() != null) {
for (AggregationServiceAggExpressionDesc aggExpressionDesc : factoryDesc.getAggregationServiceFactoryDesc().getExpressions()) {
aggExpressionDesc.assignFuture(subselectEntry.getValue().getSubselectAggregationService());
}
if (factoryDesc.getAggregationServiceFactoryDesc().getGroupKeyExpressions() != null) {
for (ExprAggregateNodeGroupKey groupKeyExpr : factoryDesc.getAggregationServiceFactoryDesc().getGroupKeyExpressions()) {
groupKeyExpr.assignFuture(subselectEntry.getValue().getSubselectAggregationService());
}
}
}
// initialize "prior" nodes in the subselect
if (strategyInstance.getPriorStrategies() != null) {
for (Map.Entry<ExprPriorNode, ExprPriorEvalStrategy> entry : strategyInstance.getPriorStrategies().entrySet()) {
entry.getKey().setPriorStrategy(entry.getValue());
}
}
// initialize "prev" nodes in the subselect
if (strategyInstance.getPreviousNodeStrategies() != null) {
for (Map.Entry<ExprPreviousNode, ExprPreviousEvalStrategy> entry : strategyInstance.getPreviousNodeStrategies().entrySet()) {
entry.getKey().setEvaluator(entry.getValue());
}
}
}
}