@Override public Void visitRemoteSource(RemoteSourceNode node, Integer indent) { print(indent, "- Remote%s[%s] => [%s]", node.getOrderingScheme().isPresent() ? "Merge" : "Source", Joiner.on(',').join(node.getSourceFragmentIds()), formatOutputs(node.getOutputSymbols())); printPlanNodesStatsAndCost(indent + 2, node); printStats(indent + 2, node.getId()); return null; }
@Override public PlanNode visitRemoteSource(RemoteSourceNode node, RewriteContext<Void> context) { return new RemoteSourceNode( node.getId(), node.getSourceFragmentIds(), canonicalizeAndDistinct(node.getOutputSymbols()), node.getOrderingScheme().map(this::canonicalizeAndDistinct), node.getExchangeType()); }
private static PlanFragment createJoinPlanFragment(JoinNode.Type joinType, String name, PlanFragment buildFragment, PlanFragment probeFragment) { RemoteSourceNode probe = new RemoteSourceNode(new PlanNodeId("probe_id"), probeFragment.getId(), ImmutableList.of(), Optional.empty(), REPARTITION); RemoteSourceNode build = new RemoteSourceNode(new PlanNodeId("build_id"), buildFragment.getId(), ImmutableList.of(), Optional.empty(), REPARTITION); PlanNode planNode = new JoinNode( new PlanNodeId(name + "_id"), joinType, probe, build, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(probe.getOutputSymbols()) .addAll(build.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); return createFragment(planNode); }
private static PlanFragment createBroadcastJoinPlanFragment(String name, PlanFragment buildFragment) { Symbol symbol = new Symbol("column"); PlanNode tableScan = new TableScanNode( new PlanNodeId(name), new TableHandle(new ConnectorId("test"), new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column"))); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("build_id"), buildFragment.getId(), ImmutableList.of(), Optional.empty(), REPLICATE); PlanNode join = new JoinNode( new PlanNodeId(name + "_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(REPLICATED)); return createFragment(join); }
ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(),
@Override public Void visitRemoteSource(RemoteSourceNode node, Void context) { builder.addAll(node.getOutputSymbols()); return null; }
@Override public Void visitRemoteSource(RemoteSourceNode node, Integer indent) { print(indent, "- RemoteSource[%s] => [%s]", Joiner.on(',').join(node.getSourceFragmentIds()), formatOutputs(node.getOutputSymbols())); return null; }
@Override public PlanNode visitRemoteSource(RemoteSourceNode node, RewriteContext<Void> context) { return new RemoteSourceNode(node.getId(), node.getSourceFragmentIds(), canonicalizeAndDistinct(node.getOutputSymbols())); }