test_class.file: plink-sql/plink-sql-core/src/test/java/com/github/hairless/plink/sql/SqlDebugDriverTest.java
test_class.identifier: SqlDebugDriverTest
test_case.body: @Test
      public void debug() throws Exception {
          String sql =
                  "create table t1( a int,b string, c int) with ( 'connector' = 'collection','data'='[]');" +
                          "create table t2(a int comment '测试',b string,c int) with ( 'connector' = 'print');" +
                          "create view temp_view as select * from t1;" +
                          "insert into t2(a,b,c) select a,b,c from temp_view t1;" +
                          "insert into t2(a,b,c) select a,b,c from temp_view t1;";
          List<String> sourceData = Stream.of(
                  new JSONObject().fluentPut("a", 1).fluentPut("b", "1000").fluentPut("c", 2).toJSONString(),
                  new JSONObject().fluentPut("a", 2).fluentPut("b", "1000").fluentPut("c", 3).toJSONString(),
                  new JSONObject().fluentPut("a", 3).fluentPut("b", "2000").fluentPut("c", 4).toJSONString(),
                  new JSONObject().fluentPut("a", 4).fluentPut("b", "2000").fluentPut("c", 5).toJSONString(),
                  new JSONObject().fluentPut("a", 5).fluentPut("b", "3000").fluentPut("c", 6).toJSONString()
          ).collect(Collectors.toList());
          SqlDebugConfig sqlDebugConfig = new SqlDebugConfig();
          HashMap<String, SqlDebugConfig.SourceConfig> sourceConfigMap = new HashMap<>();
          sourceConfigMap.put("t1", new SqlDebugConfig.SourceConfig(sourceData));
          sqlDebugConfig.setSourceConfigMap(sourceConfigMap);
          sqlDebugConfig.setSql(sql);
          log.info("sqlDebugConfig={}", JSON.toJSONString(sqlDebugConfig));
          Map<String, List<String>> debugResult = SqlDebugDriver.debug(sqlDebugConfig);
          assert MapUtils.isNotEmpty(debugResult);
      }
test_case.class_method_signature: SqlDebugDriverTest.debug()
test_case.full_signature: @Test public void debug()
test_case.identifier: debug
test_case.invocations: collect of toJSONString fluentPut fluentPut fluentPut toJSONString fluentPut fluentPut fluentPut toJSONString fluentPut fluentPut fluentPut toJSONString fluentPut fluentPut fluentPut toJSONString fluentPut fluentPut fluentPut toList put setSourceConfigMap setSql info toJSONString debug isNotEmpty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void debug()
focal_class.file: plink-sql/plink-sql-core/src/main/java/com/github/hairless/plink/sql/SqlDebugDriver.java
focal_class.identifier: SqlDebugDriver
focal_class.class_method_signature: SqlDebugDriver.debug(SqlDebugConfig sqlDebugConfig)
focal_class.full_signature: public static Map<String, List<String>> debug(SqlDebugConfig sqlDebugConfig)
focal_class.identifier: debug
focal_class.modifiers: public static
focal_class.parameters: (SqlDebugConfig sqlDebugConfig)
focal_class.return: Map<String, List<String>>
focal_class.signature: Map<String, List<String>> debug(SqlDebugConfig sqlDebugConfig)
focal_class.class_method_signature: SqlDebugDriver.handleDebugSql(final String identifier, String sql, SqlDebugConfig sqlDebugConfig)
focal_class.full_signature: private static String handleDebugSql(final String identifier, String sql, SqlDebugConfig sqlDebugConfig)
focal_class.identifier: handleDebugSql
focal_class.modifiers: private static
focal_class.parameters: (final String identifier, String sql, SqlDebugConfig sqlDebugConfig)
focal_class.return: String
focal_class.signature: String handleDebugSql(final String identifier, String sql, SqlDebugConfig sqlDebugConfig)
focal_class.class_method_signature: SqlDebugDriver.buildDebugSourceSql(SqlParseNode sourceTable, SqlDebugConfig.SourceConfig sourceConfig)
focal_class.full_signature: private static String buildDebugSourceSql(SqlParseNode sourceTable, SqlDebugConfig.SourceConfig sourceConfig)
focal_class.identifier: buildDebugSourceSql
focal_class.modifiers: private static
focal_class.parameters: (SqlParseNode sourceTable, SqlDebugConfig.SourceConfig sourceConfig)
focal_class.return: String
focal_class.signature: String buildDebugSourceSql(SqlParseNode sourceTable, SqlDebugConfig.SourceConfig sourceConfig)
focal_class.class_method_signature: SqlDebugDriver.buildDebugSinkSql(String identifier, SqlParseNode sinkTable)
focal_class.full_signature: private static String buildDebugSinkSql(String identifier, SqlParseNode sinkTable)
focal_class.identifier: buildDebugSinkSql
focal_class.modifiers: private static
focal_class.parameters: (String identifier, SqlParseNode sinkTable)
focal_class.return: String
focal_class.signature: String buildDebugSinkSql(String identifier, SqlParseNode sinkTable)
focal_class.class_method_signature: SqlDebugDriver.buildDebugSinkSql(String identifier, SqlParseNode sinkTable, String newTableName)
focal_class.full_signature: private static String buildDebugSinkSql(String identifier, SqlParseNode sinkTable, String newTableName)
focal_class.identifier: buildDebugSinkSql
focal_class.modifiers: private static
focal_class.parameters: (String identifier, SqlParseNode sinkTable, String newTableName)
focal_class.return: String
focal_class.signature: String buildDebugSinkSql(String identifier, SqlParseNode sinkTable, String newTableName)
focal_class.class_method_signature: SqlDebugDriver.buildDebugInsertSql(SqlParseNode fromTable, String targetTableName)
focal_class.full_signature: private static String buildDebugInsertSql(SqlParseNode fromTable, String targetTableName)
focal_class.identifier: buildDebugInsertSql
focal_class.modifiers: private static
focal_class.parameters: (SqlParseNode fromTable, String targetTableName)
focal_class.return: String
focal_class.signature: String buildDebugInsertSql(SqlParseNode fromTable, String targetTableName)
focal_class.class_method_signature: SqlDebugDriver.filterFormatProperties(Map<String, String> properties)
focal_class.full_signature: private static Map<String, String> filterFormatProperties(Map<String, String> properties)
focal_class.identifier: filterFormatProperties
focal_class.modifiers: private static
focal_class.parameters: (Map<String, String> properties)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> filterFormatProperties(Map<String, String> properties)
focal_class.class_method_signature: SqlDebugDriver.newSqlTableOption(String key, String value)
focal_class.full_signature: private static SqlTableOption newSqlTableOption(String key, String value)
focal_class.identifier: newSqlTableOption
focal_class.modifiers: private static
focal_class.parameters: (String key, String value)
focal_class.return: SqlTableOption
focal_class.signature: SqlTableOption newSqlTableOption(String key, String value)
focal_method.body: public static Map<String, List<String>> debug(SqlDebugConfig sqlDebugConfig) throws Exception {
          Preconditions.checkNotNull(sqlDebugConfig, "sqlDebugConfig should be not null");
          Preconditions.checkNotNull(sqlDebugConfig.getSql(), "sql should be not null");
          String identifier = UUID.randomUUID().toString();
          String debugSql = handleDebugSql(identifier, sqlDebugConfig.getSql(), sqlDebugConfig);
          log.debug("start sql debug,sql:{}", debugSql);
          SqlConfig config = SqlConfig.builder().sql(debugSql).jobName("sql_job_debug_test").build();
          SqlJob sqlJob = new SqlJob(config);
          try {
              CollectionDataWarehouse.registerLock(identifier);
              sqlJob.start();
              return CollectionDataWarehouse.getData(identifier);
          } finally {
              CollectionDataWarehouse.remove(identifier);
          }
      }
focal_method.class_method_signature: SqlDebugDriver.debug(SqlDebugConfig sqlDebugConfig)
focal_method.full_signature: public static Map<String, List<String>> debug(SqlDebugConfig sqlDebugConfig)
focal_method.identifier: debug
focal_method.invocations: checkNotNull checkNotNull getSql toString randomUUID handleDebugSql getSql debug build jobName sql builder registerLock start getData remove
focal_method.modifiers: public static
focal_method.parameters: (SqlDebugConfig sqlDebugConfig)
focal_method.return: Map<String, List<String>>
focal_method.signature: Map<String, List<String>> debug(SqlDebugConfig sqlDebugConfig)