use of io.trino.sql.planner.InputExtractor in project trino by trinodb.
the class SqlQueryExecution method doPlanQuery.
private PlanRoot doPlanQuery() {
// plan query
PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
LogicalPlanner logicalPlanner = new LogicalPlanner(stateMachine.getSession(), planOptimizers, idAllocator, plannerContext, typeAnalyzer, statsCalculator, costCalculator, stateMachine.getWarningCollector());
Plan plan = logicalPlanner.plan(analysis);
queryPlan.set(plan);
// fragment the plan
SubPlan fragmentedPlan = planFragmenter.createSubPlans(stateMachine.getSession(), plan, false, stateMachine.getWarningCollector());
// extract inputs
List<Input> inputs = new InputExtractor(plannerContext.getMetadata(), stateMachine.getSession()).extractInputs(fragmentedPlan);
stateMachine.setInputs(inputs);
stateMachine.setOutput(analysis.getTarget());
boolean explainAnalyze = analysis.getStatement() instanceof ExplainAnalyze;
return new PlanRoot(fragmentedPlan, !explainAnalyze);
}
Aggregations