public static Statement createStatement(TSQueryTemplateReq req) {
    long startTime = System.nanoTime();
    Statement result = null;
    switch (TemplateQueryType.values()[req.getQueryType()]) {
      case SHOW_MEASUREMENTS:
        result = new ShowNodesInSchemaTemplateStatement(req.getName());
        break;
      case SHOW_TEMPLATES:
        result = new ShowSchemaTemplateStatement();
        break;
      case SHOW_SET_TEMPLATES:
        result = new ShowPathSetTemplateStatement(req.getName());
        break;
      case SHOW_USING_TEMPLATES:
        result =
            new ShowPathsUsingTemplateStatement(
                new PartialPath(SqlConstant.getSingleRootArray()), req.getName());
        break;
      default:
        break;
    }
    PERFORMANCE_OVERVIEW_METRICS.recordParseCost(System.nanoTime() - startTime);
    return result;
  }
Convert SQL and RPC requests to {@link Statement}.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/StatementGenerator.java