public SubPlanBuilder visitTableWriter(TableWriterNode node, Void context)
{
SubPlanBuilder subPlanBuilder = node.getSource().accept(this, context);
if (createSingleNodePlan) {
subPlanBuilder.setRoot(new TableWriterNode(node.getId(),
subPlanBuilder.getRoot(),
node.getTable(),
node.getColumns(),
node.getOutput()));
}
else {
// Put a simple SUM(<output symbol>) on top of the table writer node
FunctionInfo sum = metadata.getFunction(QualifiedName.of("sum"), ImmutableList.of(Type.BIGINT));
Symbol intermediateOutput = allocator.newSymbol(node.getOutput().toString(), sum.getReturnType());
TableWriterNode writer = new TableWriterNode(node.getId(),
subPlanBuilder.getRoot(),
node.getTable(),
node.getColumns(),
intermediateOutput);