public StageExecutionPlan withBucketToPartition(Optional<int[]> bucketToPartition) { return new StageExecutionPlan(fragment.withBucketToPartition(bucketToPartition), splitSources, subStages); }
private StageExecutionPlan doPlan(SubPlan root, Session session, ImmutableList.Builder<SplitSource> allSplitSources) { PlanFragment currentFragment = root.getFragment(); // get splits for this fragment, this is lazy so split assignments aren't actually calculated here Map<PlanNodeId, SplitSource> splitSources = currentFragment.getRoot().accept(new Visitor(session, currentFragment.getStageExecutionDescriptor(), allSplitSources), null); // create child stages ImmutableList.Builder<StageExecutionPlan> dependencies = ImmutableList.builder(); for (SubPlan childPlan : root.getChildren()) { dependencies.add(doPlan(childPlan, session, allSplitSources)); } return new StageExecutionPlan( currentFragment, splitSources, dependencies.build()); }
StatsAndCosts.empty()); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)),
public StageExecutionPlan withBucketToPartition(Optional<int[]> bucketToPartition) { return new StageExecutionPlan(fragment.withBucketToPartition(bucketToPartition), dataSource, subStages); }
public StageExecutionPlan plan(SubPlan root, Session session) { PlanFragment currentFragment = root.getFragment(); // get splits for this fragment, this is lazy so split assignments aren't actually calculated here Visitor visitor = new Visitor(session); Optional<SplitSource> splits = currentFragment.getRoot().accept(visitor, null); // create child stages ImmutableList.Builder<StageExecutionPlan> dependencies = ImmutableList.builder(); for (SubPlan childPlan : root.getChildren()) { dependencies.add(plan(childPlan, session)); } return new StageExecutionPlan( currentFragment, splits, dependencies.build()); }
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); // table scan with splitCount splits PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null), new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of()), ImmutableList.of(), Optional.<Symbol>empty(), Optional.<Symbol>empty()), ImmutableMap.<Symbol, Type>of(symbol, VARCHAR), SOURCE_DISTRIBUTION, tableScanNodeId, new PartitionFunctionBinding(SINGLE_DISTRIBUTION, ImmutableList.of(symbol), ImmutableList.of())); return new StageExecutionPlan(testFragment, Optional.of(new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(CONNECTOR_ID), splitSource)), ImmutableList.of()); }