Browse Source

修改带qc的表名,不会去掉qc的bug

15135239248@163.com 2 years ago
parent
commit
af59801d9c

+ 5 - 0
src/main/java/com/qucheng/game/data/oldsystem/sink/CdcMysqlTablesSink.java

@@ -64,6 +64,11 @@ public class CdcMysqlTablesSink extends RichSinkFunction<TransportMap> {
         }
         }
         String tableName = tableNameMap.get(value.getTableName());
         String tableName = tableNameMap.get(value.getTableName());
         tableName = StringUtils.isBlank(tableName) ? value.getTableName() : tableName;
         tableName = StringUtils.isBlank(tableName) ? value.getTableName() : tableName;
+
+        if(tableName.contains("qc_")){
+            tableName = tableName.replaceAll("qc_","");
+        }
+
         List<String> primaryKeys = value.getPrimaryKeys();
         List<String> primaryKeys = value.getPrimaryKeys();
         Map<String, Object> data = value.getAfter();
         Map<String, Object> data = value.getAfter();
         if (Envelope.Operation.DELETE == value.getOperation()) {
         if (Envelope.Operation.DELETE == value.getOperation()) {