@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);
}