Search in sources :

Example 1 with ConnectorAwareSplitSource

use of com.facebook.presto.split.ConnectorAwareSplitSource in project presto by prestodb.

the class TestSourcePartitionedScheduler method createPlan.

private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) {
    Symbol symbol = new Symbol("column");
    // table scan with splitCount splits
    PlanNodeId tableScanNodeId = new PlanNodeId("plan_id");
    TableScanNode tableScan = new TableScanNode(tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null);
    RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of());
    PlanFragment testFragment = new PlanFragment(new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder().addAll(tableScan.getOutputSymbols()).addAll(remote.getOutputSymbols()).build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(JoinNode.DistributionType.PARTITIONED)), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)));
    return new StageExecutionPlan(testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource)), ImmutableList.of());
}
Also used : Symbol(com.facebook.presto.sql.planner.Symbol) TestingTableHandle(com.facebook.presto.sql.planner.TestingTableHandle) JoinNode(com.facebook.presto.sql.planner.plan.JoinNode) PartitioningScheme(com.facebook.presto.sql.planner.PartitioningScheme) StageExecutionPlan(com.facebook.presto.sql.planner.StageExecutionPlan) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) ConnectorAwareSplitSource(com.facebook.presto.split.ConnectorAwareSplitSource) PlanNodeId(com.facebook.presto.sql.planner.plan.PlanNodeId) TestingColumnHandle(com.facebook.presto.sql.planner.TestingColumnHandle) RemoteSourceNode(com.facebook.presto.sql.planner.plan.RemoteSourceNode) TableScanNode(com.facebook.presto.sql.planner.plan.TableScanNode) TestingTableHandle(com.facebook.presto.sql.planner.TestingTableHandle) TableHandle(com.facebook.presto.metadata.TableHandle) PlanFragmentId(com.facebook.presto.sql.planner.plan.PlanFragmentId)

Aggregations

TableHandle (com.facebook.presto.metadata.TableHandle)1 ConnectorAwareSplitSource (com.facebook.presto.split.ConnectorAwareSplitSource)1 PartitioningScheme (com.facebook.presto.sql.planner.PartitioningScheme)1 PlanFragment (com.facebook.presto.sql.planner.PlanFragment)1 StageExecutionPlan (com.facebook.presto.sql.planner.StageExecutionPlan)1 Symbol (com.facebook.presto.sql.planner.Symbol)1 TestingColumnHandle (com.facebook.presto.sql.planner.TestingColumnHandle)1 TestingTableHandle (com.facebook.presto.sql.planner.TestingTableHandle)1 JoinNode (com.facebook.presto.sql.planner.plan.JoinNode)1 PlanFragmentId (com.facebook.presto.sql.planner.plan.PlanFragmentId)1 PlanNodeId (com.facebook.presto.sql.planner.plan.PlanNodeId)1 RemoteSourceNode (com.facebook.presto.sql.planner.plan.RemoteSourceNode)1 TableScanNode (com.facebook.presto.sql.planner.plan.TableScanNode)1