Пример #1
0
  private Plan getLogicalPlan(Statement statement) {
    // analyze statement
    Analyzer analyzer =
        new Analyzer(session, metadata, Optional.of(this), experimentalSyntaxEnabled);

    Analysis analysis = analyzer.analyze(statement);
    PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();

    // plan statement
    LogicalPlanner logicalPlanner =
        new LogicalPlanner(session, planOptimizers, idAllocator, metadata);
    return logicalPlanner.plan(analysis);
  }
Пример #2
0
  private SubPlan getDistributedPlan(Statement statement) {
    // analyze statement
    Analyzer analyzer =
        new Analyzer(session, metadata, Optional.of(this), experimentalSyntaxEnabled);

    Analysis analysis = analyzer.analyze(statement);
    PlanNodeIdAllocator idAllocator = new PlanNodeIdAllocator();

    // plan statement
    LogicalPlanner logicalPlanner =
        new LogicalPlanner(session, planOptimizers, idAllocator, metadata);
    Plan plan = logicalPlanner.plan(analysis);

    return new DistributedLogicalPlanner(metadata, idAllocator).createSubPlans(plan, false);
  }