}
private StageExecutionPlan createJoinPlan(String planId)
{
// create table scan for build data with a single split, so it is only waiting on the no-more buffers call
StageExecutionPlan build = createTableScanPlan("build", 1);
// create an exchange to read the build data
ExchangeNode buildExchange = new ExchangeNode(new PlanNodeId(planId + "-build"),
build.getFragment().getId(),
ImmutableList.copyOf(build.getFragment().getSymbols().keySet()));
// create table scan for probe data with three splits, so it will not send the no-more buffers call
StageExecutionPlan probe = createTableScanPlan("probe", 10);
// create an exchange to read the probe data
ExchangeNode probeExchange = new ExchangeNode(new PlanNodeId(planId + "-probe"),
probe.getFragment().getId(),
ImmutableList.copyOf(probe.getFragment().getSymbols().keySet()));
// join build and probe
PlanFragment joinPlan = new PlanFragment(
new PlanFragmentId(planId),
new JoinNode(new PlanNodeId(planId), JoinNode.Type.INNER, probeExchange, buildExchange, ImmutableList.<EquiJoinClause>of()),
probe.getFragment().getSymbols(), // this is wrong, but it works
PlanDistribution.SOURCE,
new PlanNodeId(planId),
OutputPartitioning.NONE,
ImmutableList.<Symbol>of());
return new StageExecutionPlan(joinPlan,
probe.getDataSource(),
ImmutableList.of(probe, build)
);
}