use of io.prestosql.sql.planner.InputExtractor in project hetu-core by openlookeng.
the class SqlQueryExecution method doAnalyzeQuery.
private PlanRoot doAnalyzeQuery() {
// time analysis phase
stateMachine.beginAnalysis();
stateMachine.beginLogicalPlan();
// plan query
PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();
Plan plan = createPlan(analysis, stateMachine.getSession(), planOptimizers, idAllocator, metadata, new TypeAnalyzer(sqlParser, metadata), statsCalculator, costCalculator, stateMachine.getWarningCollector());
queryPlan.set(plan);
// extract inputs
List<Input> inputs = new InputExtractor(metadata, stateMachine.getSession()).extractInputs(plan.getRoot());
stateMachine.setInputs(inputs);
// extract output
stateMachine.setOutput(analysis.getTarget());
stateMachine.endLogicalPlan();
// fragment the plan
SubPlan fragmentedPlan = planFragmenter.createSubPlans(stateMachine.getSession(), plan, false, stateMachine.getWarningCollector());
// record analysis time
stateMachine.endAnalysis();
boolean explainAnalyze = analysis.getStatement() instanceof Explain && ((Explain) analysis.getStatement()).isAnalyze();
if (SystemSessionProperties.isSnapshotEnabled(getSession())) {
checkSnapshotSupport(getSession());
}
return new PlanRoot(fragmentedPlan, !explainAnalyze, extractConnectors(analysis));
}
Aggregations