Search in sources :

Example 1 with Analyzer

use of io.crate.analyze.Analyzer 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);
}
Also used : Planner(io.crate.planner.Planner) ParameterContext(io.crate.analyze.ParameterContext) Analyzer(io.crate.analyze.Analyzer) Plan(io.crate.planner.Plan)

Aggregations

Analyzer (io.crate.analyze.Analyzer)1 ParameterContext (io.crate.analyze.ParameterContext)1 Plan (io.crate.planner.Plan)1 Planner (io.crate.planner.Planner)1