use of com.facebook.presto.sql.planner.plan.PlanFragmentId in project presto by prestodb.
the class TestSourcePartitionedScheduler method createPlan.
private static SubPlan createPlan() {
VariableReferenceExpression variable = new VariableReferenceExpression(Optional.empty(), "column", VARCHAR);
// table scan with splitCount splits
TableScanNode tableScan = new TableScanNode(Optional.empty(), TABLE_SCAN_NODE_ID, new TableHandle(CONNECTOR_ID, new TestingTableHandle(), TestingTransactionHandle.create(), Optional.empty()), ImmutableList.of(variable), ImmutableMap.of(variable, new TestingColumnHandle("column")), TupleDomain.all(), TupleDomain.all());
RemoteSourceNode remote = new RemoteSourceNode(Optional.empty(), new PlanNodeId("remote_id"), new PlanFragmentId(0), ImmutableList.of(), false, Optional.empty(), GATHER);
PlanFragment testFragment = new PlanFragment(new PlanFragmentId(0), new JoinNode(Optional.empty(), new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<VariableReferenceExpression>builder().addAll(tableScan.getOutputVariables()).addAll(remote.getOutputVariables()).build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), ImmutableMap.of()), ImmutableSet.of(variable), SOURCE_DISTRIBUTION, ImmutableList.of(TABLE_SCAN_NODE_ID), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(variable)), StageExecutionDescriptor.ungroupedExecution(), false, StatsAndCosts.empty(), Optional.empty());
return new SubPlan(testFragment, ImmutableList.of());
}
use of com.facebook.presto.sql.planner.plan.PlanFragmentId in project presto by prestodb.
the class TestPlanPrinter method domainToPrintedScan.
// Creates a trivial TableScan with the given domain on some column
private String domainToPrintedScan(VariableReferenceExpression variable, ColumnHandle colHandle, Domain domain) {
TupleDomain<ColumnHandle> tupleDomain = withColumnDomains(ImmutableMap.<ColumnHandle, Domain>builder().put(colHandle, domain).build());
TableScanNode scanNode = PLAN_BUILDER.tableScan(TABLE_HANDLE_WITH_LAYOUT, ImmutableList.of(variable), ImmutableMap.of(variable, colHandle), tupleDomain, tupleDomain);
PlanFragment testFragment = new PlanFragment(new PlanFragmentId(0), scanNode, ImmutableSet.of(variable), SOURCE_DISTRIBUTION, ImmutableList.of(scanNode.getId()), new PartitioningScheme(Partitioning.create(SOURCE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(variable)), StageExecutionDescriptor.ungroupedExecution(), false, StatsAndCosts.empty(), Optional.empty());
return PlanPrinter.textPlanFragment(testFragment, FUNCTION_AND_TYPE_MANAGER, TEST_SESSION, false);
}
use of com.facebook.presto.sql.planner.plan.PlanFragmentId in project presto by prestodb.
the class PrestoSparkQueryExecutionFactory method createStageInfo.
private static StageInfo createStageInfo(QueryId queryId, SubPlan plan, List<TaskInfo> taskInfos) {
ListMultimap<PlanFragmentId, TaskInfo> taskInfoMap = ArrayListMultimap.create();
for (TaskInfo taskInfo : taskInfos) {
PlanFragmentId fragmentId = new PlanFragmentId(taskInfo.getTaskId().getStageExecutionId().getStageId().getId());
taskInfoMap.put(fragmentId, taskInfo);
}
return createStageInfo(queryId, plan, taskInfoMap);
}
Aggregations