haruki-830 commented on code in PR #4540:
URL: https://github.com/apache/flink-cdc/pull/4540#discussion_r4024473652
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/schema/common/SchemaRegistry.java:
##########
@@ -132,6 +138,28 @@ public void start() throws Exception {
this.schemaManager = new SchemaManager();
}
this.router = new TableIdRouter(routingRules, routeMode);
+ if (existingTableSchemaExpansionEnabled) {
+ try {
+ metadataApplier
+ .getExistingTableSchemaExpansionSupport()
+ .ifPresent(
+ support ->
+ this.existingTableSchemaExpander =
+ new
ExistingTableSchemaExpander(
+ metadataApplier,
support, behavior));
+ } catch (Exception e) {
+ LOG.warn(
+ "Failed to initialize existing target table schema
expansion. The sink's original schema handling will be used.",
+ e);
+ }
+ }
+ }
+
+ /** Tries optional target schema expansion without changing the sink's
failure behavior. */
+ protected void expandExistingTableSchemaIfNeeded(SchemaChangeEvent
schemaChangeEvent) {
+ if (existingTableSchemaExpander != null && schemaChangeEvent
instanceof CreateTableEvent) {
+ existingTableSchemaExpander.expand((CreateTableEvent)
schemaChangeEvent);
Review Comment:
Thanks for pointing it out! Since production callers do not need to branch
on the expansion result and always continue with the sink’s original handling,
I’ve changed expand() to return void.
--
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]