@Override public Void visitTableFinish(TableFinishNode node, Integer indent) { print(indent, "- TableCommit[%s] => [%s]", node.getTarget(), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); if (node.getStatisticsAggregation().isPresent()) { verify(node.getStatisticsAggregationDescriptor().isPresent(), "statisticsAggregationDescriptor is not present"); printStatisticAggregations(node.getStatisticsAggregation().get(), node.getStatisticsAggregationDescriptor().get(), indent + 2); } return processChildren(node, indent + 1); }
public TableFinishNode map(TableFinishNode node, PlanNode source) { return new TableFinishNode( node.getId(), source, node.getTarget(), map(node.getRowCountSymbol()), node.getStatisticsAggregation().map(this::map), node.getStatisticsAggregationDescriptor().map(descriptor -> descriptor.map(this::map))); }
@Override public PlanNode visitTableFinish(TableFinishNode node, RewriteContext<Set<Symbol>> context) { PlanNode source = context.rewrite(node.getSource(), ImmutableSet.copyOf(node.getSource().getOutputSymbols())); return new TableFinishNode( node.getId(), source, node.getTarget(), node.getRowCountSymbol(), node.getStatisticsAggregation(), node.getStatisticsAggregationDescriptor()); }
@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()); }
OperatorFactory statisticsAggregation = node.getStatisticsAggregation().map(aggregation -> { List<Symbol> groupingSymbols = aggregation.getGroupingSymbols(); if (groupingSymbols.isEmpty()) {