}
PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
PlanOptimizersFactory planOptimizersFactory = new PlanOptimizersFactory(metadata, splitManager);
QueryExplainer queryExplainer = new QueryExplainer(session, planOptimizersFactory.get(), metadata, new MockPeriodicImportManager(), new MockStorageManager());
Analyzer analyzer = new Analyzer(session, metadata, Optional.of(queryExplainer));
Analysis analysis = analyzer.analyze(statement);
Plan plan = new LogicalPlanner(session, planOptimizersFactory.get(), idAllocator, metadata, new MockPeriodicImportManager(), new MockStorageManager()).plan(analysis);
if (printPlan) {
System.out.println(PlanPrinter.textLogicalPlan(plan.getRoot(), plan.getTypes()));
}
SubPlan subplan = new DistributedLogicalPlanner(metadata, idAllocator).createSubPlans(plan, true);