use of io.crate.planner.Planner in project crate by crate.
the class SQLTransportIntegrationTest method plan.
public PlanForNode plan(String stmt) {
String[] nodeNames = internalCluster().getNodeNames();
String nodeName = nodeNames[randomIntBetween(1, nodeNames.length) - 1];
Analyzer analyzer = internalCluster().getInstance(Analyzer.class, nodeName);
Planner planner = internalCluster().getInstance(Planner.class, nodeName);
ParameterContext parameterContext = new ParameterContext(Row.EMPTY, Collections.<Row>emptyList());
Plan plan = planner.plan(analyzer.boundAnalyze(SqlParser.createStatement(stmt), SessionContext.SYSTEM_SESSION, parameterContext), UUID.randomUUID(), 0, 0);
return new PlanForNode(plan, nodeName);
}
Aggregations