@Override public StreamProperties visitOutput(OutputNode node, List<StreamProperties> inputProperties) { return Iterables.getOnlyElement(inputProperties) .translate(column -> PropertyDerivations.filterIfMissing(node.getOutputSymbols(), column)); }
private static StatsContext buildStatsContext(Plan queryPlan, OutputNode outputNode) { ImmutableMap.Builder<String, Symbol> columnSymbols = ImmutableMap.builder(); for (int columnId = 0; columnId < outputNode.getColumnNames().size(); ++columnId) { columnSymbols.put(outputNode.getColumnNames().get(columnId), outputNode.getOutputSymbols().get(columnId)); } return new StatsContext(columnSymbols.build(), queryPlan.getTypes()); }
@Override public Result apply(OutputNode outputNode, Captures captures, Context context) { return restrictChildOutputs( context.getIdAllocator(), outputNode, ImmutableSet.copyOf(outputNode.getOutputSymbols())) .map(Result::ofPlanNode) .orElse(Result.empty()); } }
@Override public ActualProperties visitOutput(OutputNode node, List<ActualProperties> inputProperties) { return Iterables.getOnlyElement(inputProperties) .translate(column -> PropertyDerivations.filterIfMissing(node.getOutputSymbols(), column)); }
@Override public Void visitOutput(OutputNode node, Set<Symbol> boundSymbols) { PlanNode source = node.getSource(); source.accept(this, boundSymbols); // visit child checkDependencies(source.getOutputSymbols(), node.getOutputSymbols(), "Invalid node. Output column dependencies (%s) not in source plan output (%s)", node.getOutputSymbols(), source.getOutputSymbols()); return null; }
@Override public PlanNode visitOutput(OutputNode node, RewriteContext<Set<Symbol>> context) { Set<Symbol> expectedInputs = ImmutableSet.copyOf(node.getOutputSymbols()); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new OutputNode(node.getId(), source, node.getColumnNames(), node.getOutputSymbols()); }
@Override public Void visitOutput(OutputNode node, Integer indent) { print(indent, "- Output[%s] => [%s]", Joiner.on(", ").join(node.getColumnNames()), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); for (int i = 0; i < node.getColumnNames().size(); i++) { String name = node.getColumnNames().get(i); Symbol symbol = node.getOutputSymbols().get(i); if (!name.equals(symbol.toString())) { print(indent + 2, "%s := %s", name, symbol); } } return processChildren(node, indent + 1); }
@Override public PlanNode visitOutput(OutputNode node, RewriteContext<Void> context) { PlanNode source = context.rewrite(node.getSource()); List<Symbol> canonical = Lists.transform(node.getOutputSymbols(), this::canonicalize); return new OutputNode(node.getId(), source, node.getColumnNames(), canonical); }
private static StatsContext buildStatsContext(Plan queryPlan, OutputNode outputNode) { ImmutableMap.Builder<String, Symbol> columnSymbols = ImmutableMap.builder(); for (int columnId = 0; columnId < outputNode.getColumnNames().size(); ++columnId) { columnSymbols.put(outputNode.getColumnNames().get(columnId), outputNode.getOutputSymbols().get(columnId)); } return new StatsContext(columnSymbols.build(), queryPlan.getTypes()); }
@Override public Void visitOutput(OutputNode node, Void context) { node.getSource().accept(this, context); builder.addAll(node.getOutputSymbols()); return null; }
@Override public Void visitOutput(OutputNode node, Integer indent) { print(indent, "- Output[%s] => [%s]", Joiner.on(", ").join(node.getColumnNames()), formatOutputs(node.getOutputSymbols())); for (int i = 0; i < node.getColumnNames().size(); i++) { String name = node.getColumnNames().get(i); Symbol symbol = node.getOutputSymbols().get(i); if (!name.equals(symbol.toString())) { print(indent + 2, "%s := %s", name, symbol); } } return processChildren(node, indent + 1); }
@Override public PlanNode visitOutput(OutputNode node, RewriteContext<Set<Symbol>> context) { Set<Symbol> expectedInputs = ImmutableSet.copyOf(node.getOutputSymbols()); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new OutputNode(node.getId(), source, node.getColumnNames(), node.getOutputSymbols()); }
@Override public Void visitOutput(OutputNode node, Void context) { PlanNode source = node.getSource(); source.accept(this, context); // visit child verifyUniqueId(node); checkDependencies(source.getOutputSymbols(), node.getOutputSymbols(), "Invalid node. Output column dependencies (%s) not in source plan output (%s)", node.getOutputSymbols(), source.getOutputSymbols()); return null; }
@Override public PlanNode visitOutput(OutputNode node, List<PlanNode> newChildren) { return new OutputNode(node.getId(), Iterables.getOnlyElement(newChildren), node.getColumnNames(), node.getOutputSymbols()); }
@Override public PlanNode visitOutput(OutputNode node, RewriteContext<Void> context) { PlanNode source = context.rewrite(node.getSource()); List<Symbol> canonical = Lists.transform(node.getOutputSymbols(), this::canonicalize); return new OutputNode(node.getId(), source, node.getColumnNames(), canonical); }