}
sources.add(relationPlan.getRoot());
}
PlanNode planNode = new UnionNode(idAllocator.getNextId(), sources.build(), symbolMapping.build());
if (node.isDistinct()) {
planNode = distinct(planNode);
}
return new RelationPlan(planNode, analysis.getOutputDescriptor(node), planNode.getOutputSymbols());
}