private Operator generateOperator(
      FragmentInstanceContext instanceContext, LocalExecutionPlanContext context, PlanNode node) {
    // Generate pipelines, return the last pipeline data structure
    // TODO Replace operator with operatorFactory to build multiple driver for one pipeline
    Operator root;
    IClientSession.SqlDialect sqlDialect =
        instanceContext.getSessionInfo() == null
            ? TREE
            : instanceContext.getSessionInfo().getSqlDialect();
    switch (sqlDialect) {
      case TREE:
        instanceContext.setIgnoreAllNullRows(true);
        root = node.accept(new OperatorTreeGenerator(), context);
        break;
      case TABLE:
        instanceContext.setIgnoreAllNullRows(false);
        root = node.accept(new TableOperatorGenerator(metadata), context);
        break;
      default:
        throw new IllegalArgumentException(String.format("Unknown sql dialect: %s", sqlDialect));
    }
    return root;
  }
Used to plan a fragment instance. One fragment instance could be split into multiple pipelines so
that a fragment instance could be run in parallel, and thus we can take full advantages of
multi-cores.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LocalExecutionPlanner.java