Map<Symbol, FunctionCall> aggregations = new LinkedHashMap<>(node.getAggregations());
Map<Symbol, Signature> functions = new LinkedHashMap<>(node.getFunctions());
PlanNode source = planRewriter.rewrite(node.getSource(), context);
if (source instanceof ProjectNode) {
ProjectNode projectNode = (ProjectNode) source;
for (Entry<Symbol, FunctionCall> entry : node.getAggregations().entrySet()) {
Symbol symbol = entry.getKey();
FunctionCall functionCall = entry.getValue();
Signature signature = node.getFunctions().get(symbol);
if (isCountConstant(projectNode, functionCall, signature)) {