Unverified Commit ed7581d3 authored by ZackYoung's avatar ZackYoung Committed by GitHub

[Bug] [CDCSOURCE] fix cdcsource split (#3030)

parent ade41206
......@@ -35,7 +35,7 @@ public class FlinkStatementUtil {
public static String getCDCInsertSql(Table table, String targetName, String sourceName) {
StringBuilder sb = new StringBuilder("INSERT INTO ");
sb.append(targetName);
sb.append("`").append(targetName).append("`");
sb.append(" SELECT\n");
for (int i = 0; i < table.getColumns().size(); i++) {
sb.append(" ");
......
......@@ -123,9 +123,9 @@ public class CreateCDCSourceOperation extends AbstractOperation implements Opera
// 分库分表所有表结构都是一样的,取出列表中第一个表名即可
String schemaTableName = table.getSchemaTableNameList().get(0);
// 真实的表名
String realSchemaName = schemaTableName.split("\\.")[0];
String tableName = schemaTableName.split("\\.")[1];
table.setColumns(driver.listColumnsSortByPK(schemaName, tableName));
table.setColumns(driver.listColumnsSortByPK(schemaName, table.getName()));
table.setColumns(driver.listColumnsSortByPK(realSchemaName, tableName));
schemaList.add(schema);
if (null != sinkDriver) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment