diff --git a/tis-plugin/src/main/java/com/qlangtech/tis/datax/impl/DataXCfgGenerator.java b/tis-plugin/src/main/java/com/qlangtech/tis/datax/impl/DataXCfgGenerator.java index cc9d2028e..a00854129 100644 --- a/tis-plugin/src/main/java/com/qlangtech/tis/datax/impl/DataXCfgGenerator.java +++ b/tis-plugin/src/main/java/com/qlangtech/tis/datax/impl/DataXCfgGenerator.java @@ -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); } } }