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)) {
aggregations.put(symbol, new FunctionCall(functionCall.getName(), null, functionCall.isDistinct(), ImmutableList.<Expression>of()));
functions.put(symbol, new Signature("count", BIGINT));