@Override public PlanNode replaceChildren(List<PlanNode> newChildren) { return new TableFinishNode( getId(), Iterables.getOnlyElement(newChildren), target, rowCountSymbol, statisticsAggregation, statisticsAggregationDescriptor); } }
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))); }
private RelationPlan createDeletePlan(Analysis analysis, Delete node) { DeleteNode deleteNode = new QueryPlanner(analysis, symbolAllocator, idAllocator, buildLambdaDeclarationToSymbolMap(analysis, symbolAllocator), metadata, session) .plan(node); TableFinishNode commitNode = new TableFinishNode( idAllocator.getNextId(), deleteNode, deleteNode.getTarget(), symbolAllocator.newSymbol("rows", BIGINT), Optional.empty(), Optional.empty()); return new RelationPlan(commitNode, analysis.getScope(node), commitNode.getOutputSymbols()); }
@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()); }
Optional.of(result.getDescriptor().map(aggregations.getMappings()::get))); TableFinishNode commitNode = new TableFinishNode( idAllocator.getNextId(), writerNode, TableFinishNode commitNode = new TableFinishNode( idAllocator.getNextId(), new TableWriterNode(
@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()); }
public TableFinishNode tableDelete(SchemaTableName schemaTableName, PlanNode deleteSource, Symbol deleteRowId) { TableWriterNode.DeleteHandle deleteHandle = new TableWriterNode.DeleteHandle( new TableHandle( new ConnectorId("testConnector"), new TestingTableHandle()), schemaTableName); return new TableFinishNode( idAllocator.getNextId(), exchange(e -> e .addSource(new DeleteNode( idAllocator.getNextId(), deleteSource, deleteHandle, deleteRowId, ImmutableList.of(deleteRowId))) .addInputsSet(deleteRowId) .singleDistributionPartitioningScheme(deleteRowId)), deleteHandle, deleteRowId, Optional.empty(), Optional.empty()); }
@Override public PlanNode visitTableFinish(TableFinishNode node, List<PlanNode> newChildren) { return new TableFinishNode(node.getId(), Iterables.getOnlyElement(newChildren), node.getTarget(), node.getOutputSymbols()); }
private RelationPlan createDeletePlan(Analysis analysis, Delete node) { QueryPlanner planner = new QueryPlanner(analysis, symbolAllocator, idAllocator, metadata, session, Optional.empty()); DeleteNode deleteNode = planner.planDelete(node); List<Symbol> outputs = ImmutableList.of(symbolAllocator.newSymbol("rows", BIGINT)); TableFinishNode commitNode = new TableFinishNode(idAllocator.getNextId(), deleteNode, deleteNode.getTarget(), outputs); return new RelationPlan(commitNode, analysis.getOutputDescriptor(), commitNode.getOutputSymbols(), Optional.empty()); }
@Override public PlanNode visitTableFinish(TableFinishNode node, RewriteContext<Set<Symbol>> context) { // Maintain the existing inputs needed for TableCommitNode PlanNode source = context.rewrite(node.getSource(), ImmutableSet.copyOf(node.getSource().getOutputSymbols())); return new TableFinishNode(node.getId(), source, node.getTarget(), node.getOutputSymbols()); }
TableFinishNode commitNode = new TableFinishNode( idAllocator.getNextId(), writerNode,
@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.getOutputSymbols()); }