test_class.declarator: MYSQL_TABLE_NAME = "edu_manage.department"
test_class.modifier: private static final
test_class.original_string: private static final String MYSQL_TABLE_NAME = "edu_manage.department";
test_class.type: String
test_class.var_name: MYSQL_TABLE_NAME
test_class.declarator: ES_TABLE_NAME = "student_profile.student"
test_class.modifier: private static final
test_class.original_string: private static final String ES_TABLE_NAME = "student_profile.student";
test_class.type: String
test_class.var_name: ES_TABLE_NAME
test_class.declarator: HIVE_TABLE_NAME = "action_required.homework_content"
test_class.modifier: private static final
test_class.original_string: private static final String HIVE_TABLE_NAME = "action_required.homework_content";
test_class.type: String
test_class.var_name: HIVE_TABLE_NAME
test_class.declarator: NODE = EmbeddedElasticsearchPolicy.create()
test_class.modifier: @ClassRule
      public static final
test_class.original_string: @ClassRule
      public static final EmbeddedElasticsearchPolicy NODE = EmbeddedElasticsearchPolicy.create();
test_class.type: EmbeddedElasticsearchPolicy
test_class.var_name: NODE
test_class.file: core/src/test/java/com/qihoo/qsql/plan/QueryProcedureProducerTest.java
test_class.identifier: QueryProcedureProducerTest
test_case.body: @Test
      public void testDirectQueryProcedure() {
          String sql = "SELECT dep_id FROM edu_manage.department WHERE dep_id = 1";
          QueryProcedure queryProcedure =
              new QueryProcedureProducer(getSchemaPath(Collections.singletonList(MYSQL_TABLE_NAME)))
                  .createQueryProcedure(sql);
          Assert.assertEquals(queryProcedure.getClass(), DirectQueryProcedure.class);
      }
test_case.class_method_signature: QueryProcedureProducerTest.testDirectQueryProcedure()
test_case.full_signature: @Test public void testDirectQueryProcedure()
test_case.identifier: testDirectQueryProcedure
test_case.invocations: createQueryProcedure getSchemaPath singletonList assertEquals getClass
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDirectQueryProcedure()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(QueryProcedureProducer.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(QueryProcedureProducer.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: config = null
focal_class.modifier: private
focal_class.original_string: private FrameworkConfig config = null;
focal_class.type: FrameworkConfig
focal_class.var_name: config
focal_class.declarator: funcTable = SqlRunnerFuncTable.getInstance(RunnerType.DEFAULT)
focal_class.modifier: private
focal_class.original_string: private SqlRunnerFuncTable funcTable = SqlRunnerFuncTable.getInstance(RunnerType.DEFAULT);
focal_class.type: SqlRunnerFuncTable
focal_class.var_name: funcTable
focal_class.declarator: builder
focal_class.modifier: private
focal_class.original_string: private Builder builder;
focal_class.type: Builder
focal_class.var_name: builder
focal_class.declarator: output = null
focal_class.modifier: private
focal_class.original_string: private SqlNode output = null;
focal_class.type: SqlNode
focal_class.var_name: output
focal_class.file: core/src/main/java/com/qihoo/qsql/plan/QueryProcedureProducer.java
focal_class.identifier: QueryProcedureProducer
focal_class.class_method_signature: QueryProcedureProducer.QueryProcedureProducer(String jsonPath, Builder builder)
focal_class.full_signature: public  QueryProcedureProducer(String jsonPath, Builder builder)
focal_class.identifier: QueryProcedureProducer
focal_class.modifiers: public
focal_class.parameters: (String jsonPath, Builder builder)
focal_class.signature:  QueryProcedureProducer(String jsonPath, Builder builder)
focal_class.class_method_signature: QueryProcedureProducer.QueryProcedureProducer(String jsonPath)
focal_class.full_signature: public  QueryProcedureProducer(String jsonPath)
focal_class.identifier: QueryProcedureProducer
focal_class.modifiers: public
focal_class.parameters: (String jsonPath)
focal_class.signature:  QueryProcedureProducer(String jsonPath)
focal_class.class_method_signature: QueryProcedureProducer.createQueryProcedure(String sql)
focal_class.full_signature: public QueryProcedure createQueryProcedure(String sql)
focal_class.identifier: createQueryProcedure
focal_class.modifiers: public
focal_class.parameters: (String sql)
focal_class.return: QueryProcedure
focal_class.signature: QueryProcedure createQueryProcedure(String sql)
focal_class.class_method_signature: QueryProcedureProducer.createLoadProcedure()
focal_class.full_signature: private LoadProcedure createLoadProcedure()
focal_class.identifier: createLoadProcedure
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: LoadProcedure
focal_class.signature: LoadProcedure createLoadProcedure()
focal_class.class_method_signature: QueryProcedureProducer.initPlannerConfig(String jsonPath)
focal_class.full_signature: private void initPlannerConfig(String jsonPath)
focal_class.identifier: initPlannerConfig
focal_class.modifiers: private
focal_class.parameters: (String jsonPath)
focal_class.return: void
focal_class.signature: void initPlannerConfig(String jsonPath)
focal_class.class_method_signature: QueryProcedureProducer.buildLogicalPlan(String sql)
focal_class.full_signature: private RelNode buildLogicalPlan(String sql)
focal_class.identifier: buildLogicalPlan
focal_class.modifiers: private
focal_class.parameters: (String sql)
focal_class.return: RelNode
focal_class.signature: RelNode buildLogicalPlan(String sql)
focal_class.class_method_signature: QueryProcedureProducer.optimizeLogicalPlan(RelNode root)
focal_class.full_signature: private RelNode optimizeLogicalPlan(RelNode root)
focal_class.identifier: optimizeLogicalPlan
focal_class.modifiers: private
focal_class.parameters: (RelNode root)
focal_class.return: RelNode
focal_class.signature: RelNode optimizeLogicalPlan(RelNode root)
focal_method.body: public QueryProcedure createQueryProcedure(String sql) {
          RelNode originalLogicalPlan = buildLogicalPlan(sql);
          RelNode optimizedPlan = optimizeLogicalPlan(originalLogicalPlan);
          TreeNode treeNode = optimizedPlan.accept(new LogicalViewShuttle());
  
          SubtreeSyncopator subtreeSyncopator = new SubtreeSyncopator(optimizedPlan, funcTable, builder);
          Map<RelNode, AbstractMap.SimpleEntry<String, RelOptTable>> resultRelNode =
              subtreeSyncopator.rootNodeSchemas;
  
          LoadProcedure procedure = createLoadProcedure();
  
          TransformProcedure transformProcedure =
              new DataSetTransformProcedure(procedure, subtreeSyncopator.getRoot());
  
          List<ExtractProcedure> extractProcedures = new ArrayList<>();
          for (Map.Entry<RelNode, AbstractMap.SimpleEntry<String, RelOptTable>> entry :
              resultRelNode.entrySet()) {
              extractProcedures.add(PreparedExtractProcedure.createSpecificProcedure(
                  transformProcedure, ((RelOptTableImpl) entry.getValue().getValue()),
                  config, entry.getKey(),
                  entry.getValue().getKey(),
                  (output instanceof SqlInsertOutput)
                      ? ((SqlInsertOutput) output).getSelect() : output, JdbcSourceInfo.getSourceMap()));
              //if table is mongo table and set connection information properties to builder object so as to set
              // parameters when do spark-submit job
              if (((RelOptTableImpl) entry.getValue().getValue()).getTable() instanceof MongoTable) {
                  builder.setProperties(((MongoTable) ((RelOptTableImpl) entry.getValue().getValue()).getTable())
                      .getProperties());
              }
          }
          QueryProcedure queryProcedure = new ProcedurePortFire(extractProcedures).optimize();
          queryProcedure.setTreeNode(treeNode);
          return queryProcedure;
      }
focal_method.class_method_signature: QueryProcedureProducer.createQueryProcedure(String sql)
focal_method.full_signature: public QueryProcedure createQueryProcedure(String sql)
focal_method.identifier: createQueryProcedure
focal_method.invocations: buildLogicalPlan optimizeLogicalPlan accept createLoadProcedure getRoot entrySet add createSpecificProcedure getValue getValue getKey getKey getValue getSelect getSourceMap getTable getValue getValue setProperties getProperties getTable getValue getValue optimize setTreeNode
focal_method.modifiers: public
focal_method.parameters: (String sql)
focal_method.return: QueryProcedure
focal_method.signature: QueryProcedure createQueryProcedure(String sql)