use of io.prestosql.sql.planner.plan.ExplainAnalyzeNode in project hetu-core by openlookeng.
the class TestVerifyOnlyOneOutputNode method testValidateFailed.
@Test(expectedExceptions = IllegalStateException.class)
public void testValidateFailed() {
// random plan with 2 output nodes
PlanNode root = new OutputNode(idAllocator.getNextId(), new ExplainAnalyzeNode(idAllocator.getNextId(), new OutputNode(idAllocator.getNextId(), new ProjectNode(idAllocator.getNextId(), new ValuesNode(idAllocator.getNextId(), ImmutableList.of(), ImmutableList.of()), Assignments.of()), ImmutableList.of(), ImmutableList.of()), new Symbol("a"), false), ImmutableList.of(), ImmutableList.of());
new VerifyOnlyOneOutputNode().validate(root, null, null, null, null, WarningCollector.NOOP);
}
use of io.prestosql.sql.planner.plan.ExplainAnalyzeNode in project hetu-core by openlookeng.
the class LogicalPlanner method createExplainAnalyzePlan.
private RelationPlan createExplainAnalyzePlan(Analysis analysis, Explain statement) {
RelationPlan underlyingPlan = planStatementWithoutOutput(analysis, statement.getStatement());
PlanNode root = underlyingPlan.getRoot();
Scope scope = analysis.getScope(statement);
Symbol outputSymbol = planSymbolAllocator.newSymbol(scope.getRelationType().getFieldByIndex(0));
root = new ExplainAnalyzeNode(idAllocator.getNextId(), root, outputSymbol, statement.isVerbose());
return new RelationPlan(root, scope, ImmutableList.of(outputSymbol));
}
Aggregations