Skip to content

Commit

Permalink
[Bug] [CDCSOURCE] fix cdcsource split (DataLinkDC#3030)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyoungh authored Jan 19, 2024
1 parent ade4120 commit ed7581d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private 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(" ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public TableResult execute(Executor executor) {
// 分库分表所有表结构都是一样的,取出列表中第一个表名即可
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) {
Expand Down

0 comments on commit ed7581d

Please sign in to comment.