@Override
public PlanNode visitTableFinish(TableFinishNode node, RewriteContext<Context> context)
{
PlanNode child = node.getSource();
TableWriterNode.WriterTarget originalTarget = getTarget(child);
TableWriterNode.WriterTarget newTarget = createWriterTarget(originalTarget);
context.get().addMaterializedHandle(originalTarget, newTarget);
child = child.accept(this, context);
return new TableFinishNode(
node.getId(),
child,
newTarget,
node.getRowCountSymbol(),
node.getStatisticsAggregation(),
node.getStatisticsAggregationDescriptor());
}