DongLiang-0 commented on code in PR #313:
URL:
https://github.com/apache/doris-flink-connector/pull/313#discussion_r1473733598
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/sink/writer/serializer/JsonDebeziumSchemaSerializer.java:
##########
@@ -156,13 +161,25 @@ public DorisRecord serialize(String record) throws
IOException {
return null;
}
- if (firstLoad) {
- schemaChange.init(recordRoot);
- firstLoad = false;
+ Map<String, String> tableMapping = schemaChange.getTableMapping();
+ if (initSchemaChange(firstLoad, tableMapping)) {
+ schemaChange.init(recordRoot, initTableSet);
+ this.firstLoad = false;
}
+
return dataChange.serialize(record, recordRoot, op);
}
+ private boolean initSchemaChange(boolean firstLoad, Map<String, String>
tableMapping) {
+ if (firstLoad) {
+ return true;
+ }
+ tableMappingSet.clear();
+ tableMappingSet.addAll(tableMapping.keySet());
+ tableMappingSet.removeAll(initTableSet);
Review Comment:
Sure, tableMapping is built when the program starts. When a new table is
added, the latest tableMapping will be maintained in `JsonDebeziumSchemaChange`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]