class SqlDebugDriver {

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

}