PlanNode source = planRewriter.rewrite(node.getSource(), context);
if (source instanceof ProjectNode) {
ImmutableMap.Builder<Symbol, Expression> projections = ImmutableMap.builder();
for (Map.Entry<Symbol, Expression> projection : node.getOutputMap().entrySet()) {
Expression inlined = ExpressionTreeRewriter.rewriteWith(new ExpressionSymbolInliner(((ProjectNode) source).getOutputMap()), projection.getValue());
projections.put(projection.getKey(), inlined);
}
return new ProjectNode(node.getId(), ((ProjectNode) source).getSource(), projections.build());
}