Skip to content

Commit

Permalink
nomatter isGenerateCreateDDLSwitchOff is on or not , DDL script will …
Browse files Browse the repository at this point in the history
…be generated at the end of create DataX instance,#211
  • Loading branch information
baisui1981 committed Apr 11, 2023
1 parent bea71b9 commit a9e3154
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ public static void generateTabCreateDDL(IPluginContext pluginCtx, IDataxProcesso
String sqlFileName = mapper.getTo() + IDataxProcessor.DATAX_CREATE_DDL_FILE_NAME_SUFFIX;
if (!createDDLFiles.contains(sqlFileName)) {

CreateTableSqlBuilder.CreateDDL createDDL = writer.generateCreateDDL(mapper);
if (createDDL != null) {
createDDLFiles.add(sqlFileName);
// 由于用户可能已经手动改动过生成的DDL文件,所以不能强行覆盖已经存在的DDL文件,overWrite参数应该为false
dataxProcessor.saveCreateTableDDL(pluginCtx, createDDL.getDDLScript(), sqlFileName, overWrite);
}
CreateTableSqlBuilder.CreateDDL createDDL
= Objects.requireNonNull(writer.generateCreateDDL(mapper), "createDDL can not be null");

createDDLFiles.add(sqlFileName);
// 由于用户可能已经手动改动过生成的DDL文件,所以不能强行覆盖已经存在的DDL文件,overWrite参数应该为false
dataxProcessor.saveCreateTableDDL(pluginCtx, createDDL.getDDLScript(), sqlFileName, overWrite);
}
}
}
Expand Down

0 comments on commit a9e3154

Please sign in to comment.