ss = ((AliasSymbol)ss).getSymbol();
}
if (ss instanceof ExpressionSymbol && !(ss instanceof AggregateSymbol)) {
ExpressionSymbol exprSymbol = (ExpressionSymbol)ss;
if (!exprSymbol.isDerivedExpression()) {
createdSymbols.add(ss);
}
}
AggregateSymbolCollectorVisitor.getAggregates(ss, requiredSymbols, requiredSymbols);
}
break;
}
case NodeConstants.Types.SELECT:
Criteria selectCriteria = (Criteria) node.getProperty(NodeConstants.Info.SELECT_CRITERIA);
AggregateSymbolCollectorVisitor.getAggregates(selectCriteria, requiredSymbols, requiredSymbols);
break;
case NodeConstants.Types.JOIN:
List<Criteria> crits = (List) node.getProperty(NodeConstants.Info.JOIN_CRITERIA);
if(crits != null) {
for (Criteria joinCriteria : crits) {
AggregateSymbolCollectorVisitor.getAggregates(joinCriteria, requiredSymbols, requiredSymbols);
}
}
break;
case NodeConstants.Types.GROUP:
List<SingleElementSymbol> groupCols = (List<SingleElementSymbol>) node.getProperty(NodeConstants.Info.GROUP_COLS);
if(groupCols != null) {
for (SingleElementSymbol expression : groupCols) {
if(expression instanceof ElementSymbol || expression instanceof AggregateSymbol) {
requiredSymbols.add(expression);
} else {
ExpressionSymbol exprSymbol = (ExpressionSymbol) expression;
Expression expr = exprSymbol.getExpression();
AggregateSymbolCollectorVisitor.getAggregates(expr, requiredSymbols, requiredSymbols);
createdSymbols.add(exprSymbol);
}
}
}